Yesterday I was setting up a WordPress website with Woocommerce shopping cart for one of my customers. I went through the usual routine; setting up the customer location, the tax rates and creating a product in the store to test the settings. A while ago I created a CSV file that includes all Canadian Provincial tax rates, so it was just a matter of importing this file into the system and all rates do magically appear in the tax settings. How sweet!
Where’s the magic now?
Well, the Canadian tax was imported without a problem, also the tax button was switched on in the main settings panel and the product page was set up to have the proper tax calculation for each product. As I am living in North America, all our prices do not include tax, instead tax will be calculated on top of all products and services at the check out. So I went into the shopping cart and put the product in my basket. After that I went to the check out and as I was filling in the shipping address, I noticed something odd. Normally after selecting the Country and Province, the shopping cart system will calculate the tax automatically, based on the shipping address (if you have this option selected in the main settings). Guess what? No tax was calculated! Nothing, not even a zero amount.
Checking the settings
Wow, didn’t I drink enough coffee today, was I falling asleep, what did I overlook? Here’s a list of settings I checked to see what possible could have caused this problem:
Woocommerce settings panel:
- Is the Base store location properly filled out?
- Is the Currency set to Canadian dollars?
- In the tax tab, is the “enable taxes” selected?
- In the tax tab, how will tax be calculated, I want prices exclusive of tax.
- In the tax tab, I want the tax calculated based on the customers shipping address.
- In the tax tab, the shipping tax class is selected as based on cart items.
- In the tax tab, display prices in the shop and during cart and checkout excluding tax.
- In the tax tab, display tax totals as itemized. Switching to the selection “as a single total” gave me a zero rate in the cart, but we want itemized.
- In the tax tab, check the standard rates link and see if there’s a glitch in the tax tables. I even created an overall tax rate, not based on a Country or Province, to test if tax will be calculated this way.
- Going to the product, see if the tax status is set to “taxable” and the tax class is set to the same class as where I imported the Canadian tax rates, most likely this is the “Standard” tax class.
Back to basic with WordPress:
After checking all the settings in Woocommerce, I deactivated all plugins and switched to the Twenty-Fourteen WordPress theme. After that I went back to the store front and did a page refresh, but again, no tax was calculated.
The solution
After a rerun of the Woocommerce settings and deactivating and activating all plugins, I wondered if this tax problem could have something to do with the database. I browsed to the Woocommerce website and checked what tables should be installed during the setup. I logged in to the cpanel of the website and checked if all tables were listed in my WordPress database.
Then I noticed that the woocommerce_tax_rate_locations table was missing. Very interesting, a missing database table. I had to create this database table manually. In order to have the proper settings for this database I checked the settings on my own server and created the SQL file. So, if you have the same problem, now you know where to look at. And to make your life even more easy, here’s the mysql database file* that will install this table only in your database. After creating the database table, the tax system was up and running!
* Before implementing the missing table in your database, always make a backup of your database, so you can fall back in case something goes wrong. Edit: Good remark of Alex in the comments: Before implementing the database file, make sure you’ll change the prefix to match your database tables.
[bctt tweet=”Tax didn’t show up in Woocommerce, this is how I fixed it. “]Conclusion
Installing Woocommerce in WordPress is pretty straight forward in general. I don’t know why it wouldn’t install this particular database table, it could even be related to the version of Woocommerce. So if all store settings seem to be ok, but still no tax is calculated during checkout, check your database and compare it with the tables listed on the Woocommerce website. For every problem there’s a solution and the only thing I hope for is that you’ll come across this article before you’re pulling your hairs out to fix that tax problem on your website.
Andrea Regio says
Thanks for the info! The woocommerce_tax_rate_locations table was missing and I’ve uploaded it, but the taxes are not showing… do you have any other tips?
Noud says
Hi Andrea,
Did you check all the settings in your Woocommerce setup:
– Woocommerce settings: Check if the base location of your store has been setup. Standard setup is UK, but you want to change this into the store’s location.
– Woocommerce settings – tax: make sure that “Enable taxes and tax calculations” is selected and that tax will be calculated based on the customers shipping address.
– Make sure that the standard tax rates are enabled. You’ll find this under the same tax settings – standard rates link.
– Also check if you have some standard rates setup for the store and check if these rates apply to the right geographic zones.
– Check your products: Go back to the main WordPress menu and click on “Products”. In the product data section, make sure that the standard tax rate for this product is enabled and the tax status is set to taxable.
If this doesn’t work, double check the database. Make sure all seven Woocommerce tables are installed.
Hope this helps!
alex says
Thanks so much for the tip, i was already freaking about this.
Works has expected, but off course you need to change the DB prefix.
cheers
Noud says
Hi Alex,
Glad this tip helped! Yes, of course you have to change the DB prefix if you changed the standard WP_ prefix (which you should for security reasons). In this case you want to alter the uploaded database file with your own prefix or create the table manually.
Thanks!
Louise says
Excellent! That was my problem too. Only found a reference to a missing table when setting the debug to show errors. Thanks for your post.
Louise
Noud says
Hi louise, Glad I could help!
Gian says
Thank you so much for that info! It was really frustrating not finding any info related with this problem! I spend more that a week trying to fix it.
Noud says
Hi Gian,
I’ve been pulling my hairs out also over this. Luckily I was able to locate the problem myself and share my frustrations in an article 😉
Shaylon says
Adding the table worked for me. Thanks for the sql file.
Noud says
Hi Shaylon, No worries, glad to help!
Andy says
This article is absolutely fantastic! I can’t even image how many hours this article just saved me. For some reason it didn’t even cross my mind, that there could be a table missing from the database.
Thanks!
-Andy
Noud says
Hi Andy,
It’s a needle in a haystack, easy to miss. On the surface the program seems to work fine, but sometimes we have to get under the hood to see if all parts of the system still communicate with each other.
Good to hear this article saved you a few hours of your time!
Péter says
Hi,
I was very happy finding your solution. So I have checked my database and that table was really missing. Then I have imported your table into my database, but still having the same problem. There is no tax showing and no tax being calculated.
Do you have any idea, what this can be? What I can do?
Cheers
Péter
Noud says
Hi Péter,
When you installed WordPress, did you change the WP_ database prefix? If so, you have to adjust the prefix for the new table accordingly. If this doesn’t solve the problem, you might want to run through the Woocommerce settings again.
Good luck!
Diane says
I was freaking out as well and don’t want to count the hours I’ve spent trying to figure this out. You’ve solved my problem. Uploading that table did the trick. The taxes are showing up perfectly. Thanks so much.
Noud says
Hi Diane,
Good to hear you were able to solve your tax problem!
Cathy says
I am new to this plugin and had some issue these days. Thank you for the suggestion. I have one question, could you please tell me how to add this table? I am a little bit stuck here. Could you please be more specific? Under which file to insert this sql file and how? Thanks lot in advance.
Noud says
Hi Cathy,
Before uploading the table into your database, make sure you didn’t change the wp_ prefix when you installed WordPress. You have to log in to the Cpanel of your server and open phpMyAdmin. Select the right table from the left hand side of the screen and click on the “import” button (top of the screen). Here you can upload the file into your database. Again, make sure that the rest of the tables start with wp_ before uploading.
Arlan says
Yes this works. Thank you so much for this post. I had the exact same problem and this helped me so much. I logged into phpAdmin in the cpanel and located my woocommerce database files. Then I downloaded your .sql file and edited it with a text editor to change the wp_ prefix to match the prefixes of my other woocommerce database files. Then I uploaded the .sql file to my database. I tried the site and it still didnt work. Easy fix: I just had to go to woocommerce settings and reload my tax rates so they are written into the new database. IT WORKS!
Noud says
Hi Arlan,
Good to hear it worked for you also!
Fred Sessoms says
Why is Woocommerce not aware of and fixing this major issue? It’s my understanding Woocommerce was somewhat recently acquired by WordPress. This is annoying, but I do appreciate the fixes here. Best to all!
Noud says
Hi Fred,
I hear you. I think it is a combination of Woocommerce and the MySQL version that is installed on the server. Not all hosting companies are updating their software on a regular basis. This issue happened only when installing Woocommerce for one customer. In general all database tables will be installed out of the box.
haseeb says
thanks alot dear. you saved my time 🙂
Same Issue & Perfect Solution (y)
Noud says
Glad I was able to help you out also! ;D
Ant says
Thank you very much. I spent 2 hours for to fix it until found your article.
Noud says
Hi Ant,
Glad it worked out for you as well!
Waqas says
Thanks Great Man, this worked for me!!
Noud says
Hi Waqas,
Good to hear!
josh.g says
Hello, I am Joshua Garba from Nigeria. I am working on my online shop. Had problem with displaying Tax. Your tutorial SAVED me. Thanks alot. God bless you!
Noud says
Hi Joshua,
No problem, glad I was able to help you out. Good luck with setting up your web shop!
Amar Kumar says
Hey There, I know It’s a great Help I was wondering what could be the Problem with Woocommerce and your article saved me a lot of time Thank you So much 🙂 BUT my problem is not completly solved, I can see the tax being calculated but Only for countries, If I specify a State then the Tax is not Calculated, for example the tax calculation is ok if I add US in Standard tax rates, but If I add CA in that row for State code the Tax is not Calculated. Can you please please suggest what can be the problem.
Thank you so much
Amar
Noud says
Hi Amar,
Now that’s kinda odd. I assume you did some basic checks already:
– Are taxes enabled?
– Check if shipping is calculated based on customer shipping address
– Check the tax input form for typos and if the priorities are set right in the tax table when you have multiple tax rates for one are.
– Check your products; does the tax rate apply to the products (you have to set this per product)
First of all, let me say that I am no tax expert, but I heard that California has a lot of different tax rates. If the error only applies for California, I would look into specifying tax for all regions by entering the zip codes in the tax field. If it is an overall problem, try deactivating Woocommerce and activate it again. If this doesn’t help, go to Woocommerce – System Status – Tools and click on Clear Expired Transients and Clear Transients. An if that doesn’t help, flush all tax rates by clicking on the “Delete ALL tax rates” button and do a fresh import.
Again, it is a wild guess for me as I can’t see how your store has been set up.
Good Luck!
Neil says
Thanks for sharing! Your solution worked like a charm.
Noud says
Hi Neil,
You’re very welcome!
Ken says
I’ve setup taxes before in woocommerce
but I just can’t get this one figured out
I’ve done everything indicated here (7 wc tables in the database)
https://loveinspiteof.net/beta
Please advice
Ken
Noud says
Hi Ken,
I see that no tax is charged at the checkout, but since I don’t know how you set up the tax in Woocommerce it’s a bit hard to give you proper advice. I assume you checked that all database tables have the same prefix? Tax is on, standard tax is enabled for each product and tax has been set up for the US? Country code for USA = US. If you use USA, tax is not going to work. You can try deactivating the Woocommerce plugin and activate it again. Sometimes it just needs that extra push.
Hope this helps, otherwise send me some screenshots by email or, if you feel comfortable enough, you can give me access to your WordPress admin panel.
Cindy says
Thanks for post. It is very helpful. Save me a lot of time to check where the problem is.
Noud says
Hi Cindy,
You’re very welcome. Glad you were able to fix it.
Phil says
Hi Noud,
Thank you for your help, I have ran through the suggest and still no luck.
deactivated all plugins
add tables
made sure prefix for all woocommerce is ok
… would you have any suggestions
Thank you phil
Phil says
Hi Noud,
Please ignore last, I missed one Prefix.
Thank you again.
Noud says
Hi Phil,
No worries, good thing you figured it out yourself!
busy1 says
Yeah same issue here. As much as I like the product, the folks at Woo really leave me wondering sometimes. Thanks for the fix.
Noud says
Hi Busy1,
Ah well, at least Woocommerce is free. So can’t really complain when we have to get our hands dirty to fix some rough edges.
Sean says
Thank you so much for finding this!!! This would have taken a long time to find on my own!!!!!
Noud says
Hi Sean,
Glad I could save you some time!
Cindy says
Thank you so much for this! I’m new to WooCommerce, and we were stumped about why taxes were not being applied. The missing table was the key. Thank you!
Noud says
Hi Cindy,
You are very welcome. Good to hear you were able to fix the issue as well!
Ron says
Great post. Thank you. This is a bit unrelated but you seem to have a pretty good handle on Woocommerce. I cannot for the life of me figure out how to break down taxes in the cart to PST/GST/HST in Canada. It always just shows a single tax total. Any ideas of how I might achieve this? I don’t even mind getting wet hooking into some functions but there is no obvious solution. Any ideas? I am using a standard Canadian tax rate table but perhaps I need to be using two tables or something? I’m at a loss and hope you can help.
Noud says
Hi Ron,
Thanks for your comment. When installing Woocommerce as a new plugin, it will give you the option of having the tax tables installed automatically. This only applies to the newest version of Woocommerce though. Before Woocommerce implemented this option, I used to install the Canadian tax tables by importing them via the Woocommerce admin panel – tax – standard rates. Here’s the file, it might help you out. Before importing the rates, make sure that you delete the existing rates to avoid having double rates for some tax zones. Hope this helps.
Jim R. says
Hi Noud, great thread! Jim here from southern Alberta… your neighbour! I have been struggling also with the issue of $0 tax showing….. and I did import your table into my phpmyadmin through my host… but not sure if I put it in the right place… I imported it into “rbl_wp_woocommerce_tax rates” … was that the right place? I still get $0 tax for my 5% GST which is the only tax I want in there (as we have no provincial sales tax in AB). I’m a novice at wordpress, so I don’t know what you mean by changing the prefix… where and how? If you could respond that would be great! I’m really stumped and of course I don’t want any sales going out there with the tax screwed up.. not good for business for sure! Thanks Noud. Jim
Noud says
Hi Jim,
Thanks!
There’s a lot of aspects when it comes to proper tax calculation. In your case the database tables were OK. After our nice phone conversation, I logged in to your website’s admin panel to see what’s going on and noticed that the decimal placement setting in Woocommerce was set to zero. I changed it to 2 and now your tax is working fine. I will incorporate this finding within my article later on. It might be useful for others as well!
Wayne says
I need your help on woo commerce taxes still not showing after I added the table
Noud says
Hi Wayne,
Please let me know if you still need help. In order to assist you, I will need more info on your Woocommerce setup. It will help if you can provide me with screenshots of your database, Woocommerce general settings, tax settings and general product settings for a taxable product. Alternatively, you can create a temporary user account for me, so I can log in. You can send the screenshots or account info to [email protected]
Melissa says
The table did exist in my database however I deleted it and used your script to recreate and sales tax began working. Thank you so much for this blog post!
Noud says
Hi Melissa,
Awesome! Very good to hear that you were able to fix the database table.
reza says
hi are u there Noud i need your help
Noud says
Hi Reza,
How may I help you?
Anne says
Hi Guys,
hoping you can give me a few pointers…
My “wp_woocommerce_tax_rate_locations” table did exist, but it was empty (my “wp_woocommerce_tax_rates” contains all the data I would expect from my Woocommerce settings).
I’ve been having the same problem as others above: “(includes £0.00 VAT)”.
* All products have standard tax enabled.
* “Enable taxes and tax calculations” is enabled
I’ve tried turning tax on and off, deleting all my tax settings, re-adding them, reloading the page, disabling and re-enabling plugins (including WooCommerce). I also tried dropping the “wp_woocommerce_tax_rate_locations” table and replacing it with yours.
I also tired setting tax to be calculated based on “Shop base address” (UK), but it made no difference.
Nothing seems to work and the “wp_woocommerce_tax_rate_locations” table remains empty.
Any advice greatly appreciated.
Noud says
Hi Anne,
I had one issue once where the “number of decimals” setting was the main reason tax was not charged on products. Check if the “number of decimals” setting is set to 2. You can find this option in Woocommerce, under the general tab.
Otherwise, I can take a look, but will need the login details for your website and an overview of the database. If you’d rather not give access, please provide me with screenshots of your Woocommerce settings and database, and I see what I can do.
Thanks!
Sarah says
Hello Noud;
Thank you for this article 🙂 Quick question. Any tips if all the taxes are working properly except for 1 province? All the taxes are set up and work great except NF (newfoundland and labrador) It is in the table and looks proper but no tax show up.
Please help if you are able. Thank you in advance for your time. Take care.
Noud says
Hi Sarah,
Thanks for your question. The alpha code for Newfoundland and Labrador is NL, so changing NF to NL should do the trick.
Hope this solves the issue.
Sarah says
Your amazing! Thank you so much. Worked perfect. I went for NF and LA but didn’t try NL.
Thanks again!
Sarah says
Your amazing! Thank you so much. Worked perfect. I went for NF and LA but didn’t try NL.
Thanks again!
Sarah says
Thank you thank you! Worked perfectly. I tried NF and LA. Thanks again your awesome 🙂
Noud says
Hi Sarah,
Haha, love your feedback! Good to hear you were able to solve the issue.
Have an awesome day!
Kristin says
Hi, I’m having trouble with the taxes not showing up as well. I read through all the comments but it’s a bit over my head. Is there a place where you specifically say how to check if all the tables are installed, and if not, how to install? We are in the US (California), and everything else is set perfectly as far as I can tell. Also, what prefixes are you talking about that need to be renamed? If you could explain it in the most basic terms, that would be awesome. My head is spinning trying to figure out Woocommerce and this tax issue, so ANY help would be most appreciated! Thank you!
Kristin says
Also, if you have the US version of the table you mentioned, that would be awesome (in case that ends up being the problem)? Thank you so much!
Noud says
Hi Kristin,
Thanks for your comment! I have sent you an email with a brief explanation. Alternatively you can give me temporary admin access to your website and I will take a look.
Have a wonderful day!
Jerry B says
Hi Noud.
I am really stumped on this one and I’ve received no response from WooCommerce support after 21 hours. I’d greatly appreciate your help.
I have done everything listed above and have had no success including review of WooCommerce settings and importing a new tax locations file. I’ve also deleted the wooCommerce plugin and woo services and readed both. No success.
I live in Wisconsin. It will generate the taxes but not, for example, California.
In addition, I noted in the Tax tab that for the following settings that in spite of a down arrow indicating more selections (and I know there other choices) when I click on the down arrow it does not give me the option to choose another selection for that setting:
1. Calculate tax based on is set to customer shipping address
2. Shipping tax class is set to Standard
3. Display prices in shop is set to Excluding tax
4. Display prices during cart and checkout is set to Excluding tax
Does this help at all? I’m dead in the water on this. Grasping at answers here.
I have spent so much time on this it is driving me crazy.
The woocommerce_tax_rate_locations file has 21 entries in it, seems like one for each test I performed.
https://northcoastleatherworks.com/
Thanks for any help.
Noud says
Hi Jerry,
Thanks for your reply and I am so sorry that I did not see your comment earlier. The comment notification went into the spam email folder.
Please send me an email @ [email protected] if you still have issues with the tax calculation and I’d be more than happy to take a look.
Thank you!
Vinod Rawat says
Hey there,
we are in 2020 and I have similar issue, But the Table you stated is there with table structure and no other data.
Issue is tax rate show up sometimes and sometimes won’t.
tax based on customer Geolocation is set mindmax api and database downloaded.
check customgiftings.com
tax structure:
eg; tax 5%
India: same state billing 2.5% + 2.5%
billing to other state then 5%
Billing to other countries eg ; US, canada, Australia: 0 / No tax
entering prices including tax, display including tax in shop and cart.
i’ve tried disabling plugins but same. Sometimes work sometimes don’t.
Any thoughts?
perros says
Hi there mates, its wonderful paragraph concerning cultureand entirely explained, keep it up all the
time.
mascotas says
fantastic put up, very informative. I wonder why
the other specialists of this sector don’t understand this.
You should continue your writing. I am confident,
you have a great readers’ base already!