@@ -45,16 +45,46 @@ function commerce_checkout_theme() {
4545 return $theme;
4646}
4747
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+
4874/**
4975 * Implements hook_theme_suggestions_HOOK().
5076 */
5177function commerce_checkout_theme_suggestions_commerce_checkout_form(array $variables) {
5278 $original = $variables['theme_hook_original'];
5379 $suggestions = [];
5480 $suggestions[] = $original;
81+ $suggestions[] = $original . '__' . $variables['form']['#plugin_id'];
82+ $suggestions[] = $original . '__' . $variables['form']['#entity_id'];
5583 // If the checkout form has a sidebar, suggest the enhanced layout.
5684 if (isset($variables['form']['sidebar']) && Element::isVisibleElement($variables['form']['sidebar'])) {
5785 $suggestions[] = $original . '__with_sidebar';
86+ $suggestions[] = $original . '__' . $variables['form']['#plugin_id'] . '__with_sidebar';
87+ $suggestions[] = $original . '__' . $variables['form']['#entity_id'] . '__with_sidebar';
5888 }
5989
6090 return $suggestions;
0 commit comments