I am currently trying to implement some dynamic taxing for products and shipping in WooCommerce. So far, I have used this method: WooCommerce Documentation on Tax Classes and User Roles
for setting the Tax Class of Products added to the cart based on the users data. That data is a custom checkbox in the admin area that I have created. If the check box is selected, the user should get zero-rate taxing.
This works as expected for the most part, but it ends up creating two problems that I cannot work out.
1)The checkout page never fully loads (The order summary and payment option panels have the ever-spinning 'loading' icons over them) and
2)The shipping tax does not update. Specifically, if I go from a tax class that has sales tax and shipping tax to zero-rate tax, the sales tax is updated correctly (to none), but the shipping fee still has tax applied.
I have the tax rates set up correctly in the WooCommerce settings (the zero-rate has no shipping tax), but no change.
I am using this filter to apply the change:
add_filter('woocommerce_product_get_tax_class', 'wc_diff_rate_for_user', 1, 2);
Can anyone help me get my shipping rates set properly for the cart and checkout?