Skip to content

Instantly share code, notes, and snippets.

@kloon
Last active July 4, 2017 11:27
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save kloon/7464079 to your computer and use it in GitHub Desktop.
Save kloon/7464079 to your computer and use it in GitHub Desktop.
WooCommerce add payment type to emails
<?php
// Place the following code in your theme's functions.php file to add the payment type to all emails
add_action( 'woocommerce_email_after_order_table', 'wc_add_payment_type_to_emails', 15, 2 );
function wc_add_payment_type_to_emails( $order, $is_admin_email ) {
echo '<p><strong>Payment Type:</strong> ' . $order->payment_method_title . '</p>';
}
// Place the following code in your theme's functions.php file to add the payment type to admin emails only
add_action( 'woocommerce_email_after_order_table', 'wc_add_payment_type_to_admin_emails', 15, 2 );
function wc_add_payment_type_to_admin_emails( $order, $is_admin_email ) {
if ( $is_admin_email ) {
echo '<p><strong>Payment Type:</strong> ' . $order->payment_method_title . '</p>';
}
}
?>
@bentasm1
Copy link

Thanks!

@saas786
Copy link

saas786 commented Jul 21, 2014

Thanks.

@GaganTiwari
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment