The WooCommerce settings allow you to define the default customer tax location (“Calculate tax based on” -> “Shop base address“). In this case, when a guest customer enters the checkout, tax will be calculated based on the store address.
The problem is that this option is unusual – businesses require the “Calculate tax based on” -> “Customer billing address” option in most cases.
So, today, we will be setting the default tax location when “Customer billing address” has been chosen AND the customer is either logged out (so, no billing address is set) or logged in but have no saved address (for example, a brand new customer). Enjoy!
PHP Snippet: Set Customer Default Billing Country for Tax Calculations @ WooCommerce Checkout
This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101
WooCommerce: Tax Exempt User Based on Checkout Field Value There is a nice WooCommerce function you can use to exempt someone from Tax/VAT calculations. You could, for example, enable exemption once they enter a Tax/VAT number, or maybe if they specify a given ZIP code. Such function is called set_is_vat_exempt(), and together with a little trick to “get” a checkout field on the go, […]
WooCommerce B2B: How to Set Up a Wholesale Store The ecommerce sector is seeing incredible growth, year after year, with no foreseeable end in sight. The same is true for B2B ecommerce, yet there aren’t many good platform choices available for small-to-medium businesses that want to sell wholesale. There are several SaaS solutions on the market, but these are costly, closed-source, and mostly oriented […]
WooCommerce: Display Prices Inc + Ex Tax The WooCommerce settings allow you to show prices including OR excluding tax. But what if we want to show both at the same time e.g. “$100 inc. tax – $89 ex. tax”? Well, by combining the snippet below with the snippet I already coded for variable products price range, or by installing our Mini/Plugin, you […]
WooCommerce: Get EU, EU VAT, EEA, SCA Countries When you deal with conditional payment gateways, or conditional notifications, or conditional content, you may need to use to check the current billing country against an array of countries (in plain English, you may want to know if the customer is based in a specific World area), such as the European Union. Thankfully, WooCommerce gives […]
WooCommerce: 6 Tax & Accounting Tips to Save You Time This Tax Season If just the thought of tax season gives you a headache, you’re not alone. In fact, 60 percent of small-business owners don’t feel confident about their accounting knowledge (Small Business Report – Accounting). We understand the feeling – tax season is approaching and you’re frantically trying to add up and categorize all of those shoe […]
Business Bloomer Founder
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli