Hi I am using this function to apply tax class on WooCommerce Products and also checking user role.
/* Apply a different tax rate based on the user role. */
function wc_diff_rate_for_user( $tax_class, $product ) {
if ( is_user_logged_in() && current_user_can( 'business' ) ) {
$tax_class = 'Zero Rate';
}
return $tax_class;
}
add_filter( 'woocommerce_product_tax_class', 'wc_diff_rate_for_user', 1, 2 );
that function works on simple products, but on the variable products tax is not deducting tax from the product prices.
On the variable product minimum and maximum prices still getting inclusive tax prices.
Looking for function which can apply tax on variable product minimum and maximum prices.
Thanks in advance.