Skip to content

Commit 617dec5

Browse files
mglamanmglaman
authored andcommitted
Issue #2906028 by mglaman: Add theme suggestions for the checkout order summary and completion message templates
1 parent f1665ea commit 617dec5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/checkout/commerce_checkout.module

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ function commerce_checkout_theme_suggestions_commerce_checkout_form(array $varia
5252
$original = $variables['theme_hook_original'];
5353
$suggestions = [];
5454
$suggestions[] = $original;
55+
$suggestions[] = $original . '__' . $variables['form']['#plugin_id'];
56+
$suggestions[] = $original . '__' . $variables['form']['#entity_id'];
5557
// If the checkout form has a sidebar, suggest the enhanced layout.
5658
if (isset($variables['form']['sidebar']) && Element::isVisibleElement($variables['form']['sidebar'])) {
5759
$suggestions[] = $original . '__with_sidebar';
60+
$suggestions[] = $original . '__' . $variables['form']['#plugin_id'] . '__with_sidebar';
61+
$suggestions[] = $original . '__' . $variables['form']['#entity_id'] . '__with_sidebar';
5862
}
5963

6064
return $suggestions;

modules/checkout/src/Plugin/Commerce/CheckoutFlow/CheckoutFlowBase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ public function buildForm(array $form, FormStateInterface $form_state, $step_id
257257

258258
$steps = $this->getVisibleSteps();
259259
$form['#tree'] = TRUE;
260+
$form['#entity_id'] = $this->entityId;
261+
$form['#plugin_id'] = $this->pluginId;
260262
$form['#step_id'] = $step_id;
261263
$form['#title'] = $steps[$step_id]['label'];
262264
$form['#theme'] = ['commerce_checkout_form'];

0 commit comments

Comments
 (0)