Add extra markup to payment gateway on review pane

Created on 12 February 2025, 3 months ago

The problem.

Currently the payment checkout review pane display the payment gateway name without any type of formatting and it's followed by the billing information.

When the user is on the checkout review page it's not easy to identify the selected payment method.

The solution.

Add some markup to allow the theme to set a style to highlight the payment gateway name. It could simply be a "div" with a specific class name.

Currently it's defined on commerce/modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentInformation.php:

      $summary = [
        'payment_gateway' => [
          '#markup' => $payment_gateway->getPlugin()->getDisplayLabel(),
        ],
      ];

It could became:

      $summary = [
        'payment_gateway' => [
          '#prefix" => '<div class="selected-payment-gateway>",
          '#markup' => $payment_gateway->getPlugin()->getDisplayLabel(),
          '#suffix" => '</div>",
        ],
      ];

I'm using a local patch to get this feature on my sites, but it could be easily implemented on the module itself.

What do you think?

Feature request
Status

Active

Version

3.0

Component

Payment

Created by

🇮🇹Italy finex

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024