Remove (Includes %s)
-
Hi,
Is there a working snippet to remove/hide the (Includes %s) ex tax in both site and email?I´ve tried this code but Problem is, that after using code, total coast is not showing in email. All field is empty included total price. I want to remove only thesee text “(included 20.5€ tax)”.
Have some solution for me please?
function woo_includes_tax_text_filter_1( $content ) { // set up regex match, replace regex with nothing $find = '/\<small.*small\>/Ui'; $content = preg_replace( $find, '', $content ); return $content; } add_filter( 'woocommerce_cart_totals_order_total_html', 'woo_includes_tax_text_filter_1', 99, 1 ); function woo_includes_tax_text_filter_2( $content ) { // set up regex, find matches, take only first match and return it $find = '/\<span class\=\"amount\".*\<\/span\>/Ui'; preg_match( $find, $content, $matches ); $content = $matches[0]; return $content; } add_filter( 'woocommerce_get_formatted_order_total', 'woo_includes_tax_text_filter_2', 99, 1 );
The topic ‘Remove (Includes %s)’ is closed to new replies.