Created
January 17, 2019 10:28
-
-
Save rynaldos-zz/ee4f2405a7c602af1708e013eb978dca to your computer and use it in GitHub Desktop.
Show zero rate tax line in checkout when exempt
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 ) { | |
if ( empty( $tax_totals ) && WC()->customer->is_vat_exempt() ) { | |
$tax_totals['zero-rated'] = (object) array( | |
'label' => 'Zero Rated Tax', | |
'amount' => 0, | |
'formatted_amount' => wc_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
Hi!! thanks very much for the code.
Is not working for me.
Really appreciate your help.
Regards.