Skip to content

Commit bde8300

Browse files
stephanebelazouzbojanz
authored andcommitted
Issue #2832927: Add per-order-type theme suggestions for the order receipt (#616)
1 parent 610ff49 commit bde8300

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

modules/order/commerce_order.module

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,17 @@ function commerce_order_theme_suggestions_commerce_order(array $variables) {
110110
return _commerce_entity_theme_suggestions('commerce_order', $variables);
111111
}
112112

113+
/**
114+
* Implements hook_theme_suggestions_commerce_order_receipt().
115+
*/
116+
function commerce_order_theme_suggestions_commerce_order_receipt(array $variables) {
117+
if (isset($variables['order_entity'])) {
118+
$order = $variables['order_entity'];
119+
$original = $variables['theme_hook_original'];
120+
$variables['theme_hook_suggestions'][] = $original . '__' . $order->bundle();
121+
}
122+
}
123+
113124
/**
114125
* Adds the default order_items field to an order type.
115126
*

0 commit comments

Comments
 (0)