Code-Snippets-Functions/Execute a function on a child site/WooCommerce/remove-payment-method-email-notifications.txt

8 lines
333 B
Text

add_filter( 'woocommerce_get_order_item_totals', 'remove_payment_method_row_from_emails', 10, 3 );
function remove_payment_method_row_from_emails( $total_rows, $order, $tax_display ){
// On Email notifications only
if ( ! is_wc_endpoint_url() ) {
unset($total_rows['payment_method']);
}
return $total_rows;
}