0

I have a WooCommerce site and a specific distributor who will be redirecting products from a taxable region (Germany) to a non-taxable region (Russia). Thanks to various forms, this makes them exclusive of VAT.

Through the VAT settings on WooCommerce, I setup an extra rule for the specific postal code with zero tax - unfortunately the result is a line of zero tax, and a line of standard VAT, rather than the desired line of zero tax only.

I then tried to setup the standard tax rule in Germany to exclude the single postal code, using 1-xxxxx and xxxxx-99999 where xxxxx is the number below and above the postal code respectively. THis results in a huge tax rule that WooCommerce clearly doesn't like, as it switches off any form of tax for any region at any time.

Does anyone have any suggestions as to how I could override the taxation for just this address and force it to zero? I am happy to make a hook to do this, but wouldn't know where to start.

Thanks!

2 Answers 2

2
+50

I was trying to reproduce what are you describing:

Through the VAT settings on WooCommerce, I setup an extra rule for the specific postal code with zero tax - unfortunately the result is a line of zero tax, and a line of standard VAT, rather than the desired line of zero tax only.

I then tried to setup the standard tax rule in Germany to exclude the single postal code, using 1-xxxxx and xxxxx-99999 where xxxxx is the number below and above the postal code respectively. THis results in a huge tax rule that WooCommerce clearly doesn't like, as it switches off any form of tax for any region at any time.

To test your setup and the behavior/problem you're experiencing. But I can't, it's working for me. I'm having no problem with excluding one specific postal code.

Screenshot:

enter image description here

I entered 00001-66665;66667-99999 for the taxable regions/postcodes; and 66666 for the excluded one. Then I tested this on the checkout page, it does get updated correctly every time, which means, no or to be exact 0% tax with the postcode 66666 and 50% tax for all the other postcodes, for the country germany. Additional information, the development environment I tested it on has woocommerce v2.0.13 installed.

Was this:

I have a WooCommerce site and a specific distributor who will be redirecting products from a taxable region (Germany) to a non-taxable region (Russia). Thanks to various forms, this makes them exclusive of VAT.

just informational? Or, does it describe a functionality you implemented?

Overall there isn't enough information - and no code - available to further investigate what the problem might be. I'd have to guess. But it's safe to say, your problem likely originates somewhere else.




Edit:

Like I said, the above is working for me. One thing I realized is that doing the exclusive rule the wp_woocommerce_tax_rate_locations gets bloated up from 48KiB to 13.5MiB. I guess it's just logical considering that 99999 singular entries are getting added to it, but really it's just ridiculous. And I just added the above shown 3 rules, imagine you do that for several countries/states/postcodes, that is seriously flawed in my mind. Depending on your server (setup) this might be a problem, so maybe this is the reason why it's working for me and not for you.
That considered I was thinking about a different approach. For sure you have read Setting up Taxes in WooCommerce, as you know from that the priority is used to layer tax rules, so this won't help. The whole priority concept of woocommerce is - in my mind - counterintuitive, it should be used for different excluding rules for same countries/states/postcodes - especially because this probably is the more common case. With a second option for layering taxes. But like documentation states:

Only 1 matching rate per priority will be used.

This is where the order gets relevant, like @Gerhard suggested. Another point where I'm thinking, seriously, the only way to control this is by dragging and dropping stuff. OK, enough bashing woocommerce for one post I guess, probably most people are happy with that. Coming back to your problem, you can do your setup with using a wildcard and the extra rule, if you have the right order.

Screenshot:

enter image description here

This is working for your case, at least it's on my development environment. One big advantage is that there aren't thousands of database entries involved. Of course that's only the case because you only exclude exactly one specific postcode.

2
  • Hi ialocin - thanks for your response. If I use exclusive rules, it seems to corrupt the entire ruleset and switch tax off for everyone everywhere. I tried breaking it down and doing it in blocks of 25,000 but still no joy. If I try teh suggestion below, with 0% higher priority, non compound, above the 20%, it still fails. Any suggestions gratefully accepted. Also awarding you bounty for best answer even if it didn't actually solve the problem. Nov 18, 2013 at 16:17
  • @GeorgePearce Thanks for the bounty, it absolutely wouldn't been necessary. I edited my answer, hope it helps. Nov 19, 2013 at 15:33
1

Ensure that you most specific tax rule with the 0% is above your least specific ones, so drag the 6666 rule above the 00001-66665;66667-99999 rule and it should match the most specific one.

WooCommerce matched taxes top down, so as soon as it finds a match it will stop looking for more matches unless the other rules are compound taxes.

1
  • That doesn't apply to my first approach, because those tax rules are exclusive, as you can see in my screenshot I have it below and it's working that way. But definitely +1 for hinting to this not very good documented fact! Nov 19, 2013 at 15:26

Not the answer you're looking for? Browse other questions tagged or ask your own question.