Different product category taxes based on role user
-
Hi
How Can I apply different taxes in a determinated product category depending a role user? For example:
– Professional Role user:
21% tax in Category A
10% tax in Category B
5% tax in rest of categories– Distribuitor Role user:
10% tax in category A
0% tax in category B
21% tax in rest of categoriesRight now I have created product price without taxes .I apply different taxes based on role user like this:
add_filter( 'woocommerce_before_cart_contents', 'wc_diff_rate_for_user', 1, 2 ); add_filter( 'woocommerce_before_shipping_calculator', 'wc_diff_rate_for_user', 1, 2); add_filter( 'woocommerce_before_checkout_billing_form', 'wc_diff_rate_for_user', 1, 2 ); add_filter( 'woocommerce_product_tax_class', 'wc_diff_rate_for_user', 1, 2 ); function wc_diff_rate_for_user( $tax_class ) { if ( current_user_can( 'some role user' ) ) { $tax_class = 'some tax'; } return $tax_class; }
But I dont know how apply taxes depending of product category. Its possible?
Thanks in advanced
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Different product category taxes based on role user’ is closed to new replies.