In my woocommerce web site, I have enable Tax in general WooCommerce settings.
I would like to disable tax for a specific user role programmatically ( with any hooks ), from my shop, checkout page and from order email.
How could I achieve this?
Thanks
First you need to have this specific user role set in worpress. If it's the case, let say that this custom user role is
'resellers'
for my code example.Second, you have to enable in WooCommerce settings a zero tax rate:
And then for each country, you will have to set this zero tax rate:
Third - Then this function hooked in
woocommerce_product_tax_class
will do the trick:This code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested and fully functional.
Reference: WooCommerce - Enabling "Zero rate" tax class to some specific user roles