From #2915585: Create a Twig template for the payment gateway form.

Right now we have no way to theme checkout panes. There should be "commerce_checkout_pane", "commerce_checkout_pane_PLUGIN_ID" theme hook and then Payment alters it to have the additional suggestions on operation and plugin ID.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Assigned: Unassigned » mglaman
Status: Active » Needs work
FileSize
2.02 KB

This causes panes to have no output. Need preprocess to fix "content." Ending sprint for the day.

mglaman’s picture

Assigned: mglaman » Unassigned
Status: Needs work » Needs review
FileSize
2.21 KB

Today I, shamefully, learned "render element" defines the main variable for all renderables!

Theme debug output from patch

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'commerce_checkout_pane' -->
<!-- FILE NAME SUGGESTIONS:
   * commerce-checkout-pane--shipping-information.html.twig
   x commerce-checkout-pane.html.twig
-->
<!-- BEGIN OUTPUT from 'modules/contrib/commerce/modules/checkout/templates/commerce-checkout-pane.html.twig' -->

  • bojanz committed 522e74c on 8.x-2.x authored by mglaman
    Issue #2951353 by mglaman: Provide a Twig template and theme hook...
bojanz’s picture

Status: Needs review » Fixed

Thanks, this works fine!

Added an explicit #pane_id and used it in the suggestion hook, to allow checkout flows to add panes under a different parent (due to accordions, for example).

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.