Describe your bug or feature request.
I've got a requirement where a cart block has to be rendered differently depending on if dropdown is to be displayed or not.
Block config already exists for this, all is required to expose this as a variable on block render.
Code to be updated
Add 'dropdown' variable to theme:
commerce_card.module
/**
* Implements hook_theme().
*/
function commerce_cart_theme($existing, $type, $theme, $path) {
return [
'commerce_cart_block' => [
'variables' => [
...
'dropdown' => FALSE,
...
],
],
Add '#dropdown' and value to render array:
CartBlock.php
return [
...
'#dropdown' => $this->configuration['dropdown'],
...
];
Comments
Comment #3
jannakha commentedMR 246 for review
Comment #4
vladimirausApplies and works in both configuration and display.
Comment #7
jsacksick commentedComment #8
jannakha commented