Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jjmontalban/e18f3e3cf94d8a7be6ff3d97d6efbe6c to your computer and use it in GitHub Desktop.
Save jjmontalban/e18f3e3cf94d8a7be6ff3d97d6efbe6c to your computer and use it in GitHub Desktop.
/**
* @snippet ocultar desglose de impuestos en los emails
* @author https://stackoverflow.com/questions/64767532/remove-formatted-displayed-tax-from-order-total-line-on-woocommerce-emails
*/
add_filter( 'woocommerce_get_formatted_order_total', 'change_emails_formatted_order_total', 10, 2 );
function change_emails_formatted_order_total( $formatted_total, $order ) {
// Remove from order total the formatted taxes displayed on emails notifications only
return is_wc_endpoint_url() ? $formatted_total : wc_price( $order->get_total(), array( 'currency' => $order->get_currency() ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment