Created
January 13, 2023 12:52
-
-
Save jjmontalban/e18f3e3cf94d8a7be6ff3d97d6efbe6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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