0
Answers
Vote up!
0
Vote down!

How to add / edit custom panes in checkout flow - commerce 2.x

Hi there,

I want to help contribute to commerce 2.x and thought a useful place to get familiar is the checkout flow / payment process. As a start I've created a plugin that provides a new checkout flow by simply extending CheckoutFlowWithPanesBase.

<?php
class MultistepPayment extends CheckoutFlowWithPanesBase {
}
?>

So far so good.

Next I expected no panes to be available since my directory structure just has src/Plugin/Commerce/CheckoutFlow/MultistepPayment.php and no panes defined.

Instead all of the original (module source) panes are available. So I'm guessing the CheckoutPaneManager is discovering the original Drupal/commerce_checkout/Plugin/Commerce/CheckoutPane files just fine.

When I added my own custom CompletionMessage.php pane by only changing the default message, it's now showing. It seems the manager is preferring the original definition.

What don't I understand about drupal 8 plugins that's causing the above?

Thanks!

Asked by: user001
on July 18, 2016

Comments

Hi, you can edit the Completion-Message at
modules/contrib/commerce/modules/checkout/templates/commerce-checkout-completion-message.html.twig
or at the translation Page under /admin/config/regional/translate. Use the Filter...

Best practis: Copy the twig files that you need edit to themes/your-theme/teplates. Then you can update yor Drupal witout loss informations.

- Frank W. HH-Germany on August 4, 2017