here’s a solution that hides the taxes everywhere, which means woocommerce cart, orders, invoices and delivery notes:
/**
* Hide Tax label from cart totals
*/
function example_get_cleaned_label($label) {
return preg_replace( '/\([^)]+\)/', '' , $label );
}
/**
* Hide Tax label from cart totals
*/
function example_hide_tax_label($value) {
return example_get_cleaned_label($value);
}
add_filter( 'woocommerce_cart_totals_order_total_html', 'example_hide_tax_label' );
/**
* Hide Tax label from order totals
*/
function example_hide_item_tax_label($total_rows, $order) {
$total_rows['order_total']['value'] = example_get_cleaned_label($total_rows['order_total']['value']);
return $total_rows;
}
add_filter( 'woocommerce_get_order_item_totals', 'example_hide_item_tax_label', 10, 2 );