Created
September 9, 2013 09:58
-
-
Save mikejolley/6493682 to your computer and use it in GitHub Desktop.
WooCommerce - Show zero rated tax lines when except
This file contains 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
add_filter( 'woocommerce_cart_tax_totals', 'show_zero_rate_taxes' ); | |
function show_zero_rate_taxes( $tax_totals ) { | |
global $woocommerce; | |
if ( empty( $tax_totals ) && $woocommerce->customer->is_vat_exempt() ) { | |
$tax_totals['zero-rated'] = (object) array( | |
'label' => 'Zero Rated Tax', | |
'amount' => 0, | |
'formatted_amount' => woocommerce_price( 0 ), | |
'name' => 'Zero Rated Tax', | |
'is_compound' => false | |
); | |
} | |
return $tax_totals; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome thanks for the code.
This is not working for me. Any idea?
Thanks.