• Resolved jjbte

    (@jjbte)


    I am still testing this plugin under various scenarios. I am in a state that requires sales tax to be charged on shipping. Therefore, my WooCommerce Standard Tax rates are set to tax shipping.

    When logged in as a Wholesale Tax Free user, I noticed that the products in my cart were not taxed, but shipping charges were. I added the following to my theme’s functions.php file and it seems to have done the trick:

    add_action('woocommerce_calculate_totals', 'buy_tax_free_is_vat_exempt');
    function buy_tax_free_is_vat_exempt($post_data) {
    	global $woocommerce;
    	if (current_user_can('buy_tax_free')) {
    		$woocommerce->customer->set_is_vat_exempt(true);
    	}
    }

    There may be a better way to accomplish this, so I welcome any suggestions.

    https://wordpress.org/plugins/pricing-deals-for-woocommerce/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author vark

    (@vark)

    Hi,
    Wow, you’ve delivered it all neatly tied with a bow! Thanks very much, I’ll look into this for the next release!
    Best,
    Vark

    Thread Starter jjbte

    (@jjbte)

    Thanks for your reply. I’m sure you’re a better programmer than I, and you know your plugin better than I as well. So you may very well find there’s a better way to go about accomplishing the same goal.

    Plugin Author vark

    (@vark)

    Not sure about the better programmer… the code was actually already there, but a bug kept it from being executed…
    never a dull moment.
    Best,
    Mark

    Thread Starter jjbte

    (@jjbte)

    I was looking over your documentation a bit more and realized I had missed one detail earlier. There’s a section that states a Zero Rate Tax row must be set up for the Wholesale Tax Free role to work properly. I had NOT done that, so I entered a row in my WooCommerce Settings Zero Rate Tax section. I left everything at its default value (including leaving the Shipping box checked) and then removed the added code from my functions.php file. I retested in a few different browsers for both Wholesale Tax Free and regular Customer roles and things seem to work properly. Tax is not charged on shipping for Wholesale Tax Free and it is for Customer, which is just as it should be.

    So as long as a Zero Rate tax row is added properly, the code I shared above should not be necessary. I’m sorry for missing that one important detail in your documentation. Thanks again for your reply and attention.

    Plugin Author vark

    (@vark)

    Hi,
    Once again, I’m sooo impressed with the sophistication of your anyalysis and summary of your testing. Thanks for pursuing this. But your original report did indeed point me towards some code which wasn’t working. So big props for all of it!!!!!
    Best,
    Vark

    Thread Starter jjbte

    (@jjbte)

    Thanks so much and glad I could help. I can’t imagine how time-consuming it must be to not only create plugins, but also make sure they stay current with the ever-changing WordPress (and WooCommerce). Thanks for your hard work in creating a great plugin!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Shipping taxed for Wholesale Tax Free role’ is closed to new replies.