Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created September 9, 2013 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/6493682 to your computer and use it in GitHub Desktop.
Save mikejolley/6493682 to your computer and use it in GitHub Desktop.
WooCommerce - Show zero rated tax lines when except
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;
}
@beayeric
Copy link

Awesome thanks for the code.
This is not working for me. Any idea?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment