I am trying to create a woocommerce store so that users who are engaged in wholesale trade or a designer are automatically exempted from taxes and simply lose tax from the basket / statement. I used the dynamic pricing plugin to offer different prices for different roles, but there are no options for changing taxes.
Someone posted this code:
// Place the following code in your theme functions.php file and replace tax_exempt_role with the name of the role to apply to add_action( 'init', 'woocommerce_customer_tax_exempt' ); function woocommerce_customer_tax_exempt() { global $woocommerce; if ( is_user_logged_in() ) { $tax_exempt = current_user_can( 'tax_exempt_role'); $woocommerce->customer->set_is_vat_exempt( $tax_exempt ); } }
It seems to work on the front panel, but breaks the backend. after adding it to functions.php, when will I go back to the administration area and see this: http://i.imgur.com/nNHMSAZ.png (is this just a new Chrome error page)?
To others, I could not figure out how to add 2 roles instead of one.
thanks
James source share