Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce - remove payment method from emails
<?php // Do not include this if already open!
/**
* Code goes in theme functions.php.
*/
add_filter( 'woocommerce_get_order_item_totals', 'custom_woocommerce_get_order_item_totals' );
function custom_woocommerce_get_order_item_totals( $totals ) {
unset( $totals['payment_method'] );
return $totals;
}
@Drugoy

This comment has been minimized.

Copy link

Drugoy commented Sep 20, 2016

Payment method is listed twice in emails, the above code removes only the one from the table, but there still remains this string: 'Pay with cash upon delivery.' above that table.
Do you, by any chance, know how to remove that string as well?

p.s.: thank you for your gists, Mike!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.