Home » WooCommerce: Add Payment Method to Order Emails

WooCommerce: Add Payment Method to Order Emails

by adminkys

If you wish to print the payment gateway name on order emails (in its own paragraph below the order items table), here’s a handy snippet for you.

All you need to use is the “woocommerce_email_after_order_table” hook to pick the correct position, and then the “get_payment_method_title” WooCommerce function to return the payment gateway name. Enjoy!

Add payment type to order emails in WooCommerce
Add payment type to order emails in WooCommerce

PHP Snippet: Show Payment Gateway Name @ WooCommerce Order Emails

/**
 * @snippet       Echo Payment Method Name @ Order Emails
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @testedwith    WooCommerce 3.9
 * @donate $9     https://www.tutoraspire.com
 */

add_action( 'woocommerce_email_after_order_table', 'tutoraspire_display_payment_type_name_emails', 15 );
 
function tutoraspire_display_payment_type_name_emails( $order ) {
   echo '

Payment Type:

' . $order->get_payment_method_title() . '

'; }

You may also like