Skip to content
Advertisement

Disable tax for tax exempt customers in WooCommerce

I have tax enabled for my WooCommerce installation. It calculates tax for all customer’s who live in my state (based on their shipping address). This is the default setup for WooCommerce.

Some customers are tax exempt and shouldn’t be charged tax. I created a custom field in the user profile where I can check a box to exempt customers from being charged tax. This works correctly.

I tried to find a hook where I can use that selection to disable the tax but the code I have causes the checkout page to be blank for all users. No error message is displayed.

My functions.php code is as follows:

JavaScript

Advertisement

Answer

Since Woocommerce 3 woocommerce_product_tax_class hook is deprecated and has been replaced. I have updated your 3rd function below:

JavaScript

Code goes in functions.php file of your active child theme (or active theme). It should better work.

Related: Disable tax programmatically for a specific user role

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement