-1

The commerce-order-receipt.html.twig contains a variable called {{ payment_method }}, which returns no data. Likewise, when I add Payment Method field to my orders table view, it shows no data. Payment Gateway does contain the name of the payment method used in the order. I'd like to print that value in my order receipt email, but cannot seem to find the correct syntax. So far I have tried the following.

{{ payment_gateway }}
{{ order_entity.field_payment_gateway }}
{{ order_entity.field_payment_gateway.value }}
{{ field_payment_gateway }}
{{ field_payment_gateway.value }}

All of those turn up blank in the email.

How can I show the payment gateway title in the order receipt email?

1
  • Try {{ commerce_order.payment_gateway.entity.label }} or {{ commerce_order.payment_gateway.entity.get("configuration").display_label }}. Jun 23 at 4:59

1 Answer 1

0

The patch given in Show payment instructions in the order receipt, comment #10, fixed my issue. It requires patching the commerce_order.module and commerce_payment.module files, as well as adding the display code to the order email receipt template file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.