@@ -45,16 +45,46 @@ function commerce_checkout_theme() {
45
45
return $theme;
46
46
}
47
47
48
+ /**
49
+ * Implements hook_theme_suggestions_HOOK().
50
+ */
51
+ function commerce_checkout_theme_suggestions_commerce_checkout_completion_message(array $variables) {
52
+ /** @var \Drupal\commerce_checkout\Entity\CheckoutFlowInterface $checkout_flow */
53
+ $checkout_flow = $variables['order_entity']->get('checkout_flow')->entity;
54
+ $original = $variables['theme_hook_original'];
55
+ $suggestions = [];
56
+ $suggestions[] = $original;
57
+ $suggestions[] = $original . '__' . $checkout_flow->getPluginId();
58
+ $suggestions[] = $original . '__' . $checkout_flow->id();
59
+ }
60
+
61
+ /**
62
+ * Implements hook_theme_suggestions_HOOK().
63
+ */
64
+ function commerce_checkout_theme_suggestions_commerce_checkout_order_summary(array $variables) {
65
+ /** @var \Drupal\commerce_checkout\Entity\CheckoutFlowInterface $checkout_flow */
66
+ $checkout_flow = $variables['order_entity']->get('checkout_flow')->entity;
67
+ $original = $variables['theme_hook_original'];
68
+ $suggestions = [];
69
+ $suggestions[] = $original;
70
+ $suggestions[] = $original . '__' . $checkout_flow->getPluginId();
71
+ $suggestions[] = $original . '__' . $checkout_flow->id();
72
+ }
73
+
48
74
/**
49
75
* Implements hook_theme_suggestions_HOOK().
50
76
*/
51
77
function commerce_checkout_theme_suggestions_commerce_checkout_form(array $variables) {
52
78
$original = $variables['theme_hook_original'];
53
79
$suggestions = [];
54
80
$suggestions[] = $original;
81
+ $suggestions[] = $original . '__' . $variables['form']['#plugin_id'];
82
+ $suggestions[] = $original . '__' . $variables['form']['#entity_id'];
55
83
// If the checkout form has a sidebar, suggest the enhanced layout.
56
84
if (isset($variables['form']['sidebar']) && Element::isVisibleElement($variables['form']['sidebar'])) {
57
85
$suggestions[] = $original . '__with_sidebar';
86
+ $suggestions[] = $original . '__' . $variables['form']['#plugin_id'] . '__with_sidebar';
87
+ $suggestions[] = $original . '__' . $variables['form']['#entity_id'] . '__with_sidebar';
58
88
}
59
89
60
90
return $suggestions;
0 commit comments