Christina Milburn
Christina Milburn

Reputation: 53

WooCommerce taxes calculating from wrong location

It’s been 2 months and countless hours later and I’ve still not been able to fix this.

No matter what I do, taxes are calculated based on the shop's location. I need to only charge taxes if the customer's shipping or billing address is in Illinois.

I have one set of tax rules set, for IL.

Example 1: Base state set to Illinois. Billing address and shipping address set to California (or any other state). Customer is charged IL taxes.

Example 2: Base state set to California. Billing address and shipping address set to Illinois. Customer is not charged Illinois taxes.

I've tried disabling all plugins and using default theme with no joy.

UPdating with screenshot of current settings current tax settings

Upvotes: 1

Views: 2621

Answers (3)

Shantanu Mukherjee
Shantanu Mukherjee

Reputation: 1

I found a solution . The problem is that it calculates from the default store address and always the default location is sent from the function get_tax_location( $tax_class = '', $customer = null ) . So you need to change that to customer address . I can help if anybody need but I am not sure if it will affect any other area .

Thanks Shan

Upvotes: 0

Christina Milburn
Christina Milburn

Reputation: 53

After comparing hundreds of database rows, I finally narrowed it down to 1 row, which gave details of local shipping. Using that, I did some testing and found that when my local shipping is enabled, it breaks the tax calculation.

Upvotes: 1

Christina
Christina

Reputation: 34642

In the docs:

If you use store base address, taxes will always be based on your store location and not your customer’s location.

So change it to Customer Shipping Address

Read: https://docs.woocommerce.com/document/setting-up-taxes-in-woocommerce/

enter image description here

There is no bug report: https://github.com/woocommerce/woocommerce/issues?utf8=%E2%9C%93&q=shop%20location%20calculation%20. Or any other search string I could think of.

See: https://code.tutsplus.com/articles/the-beginners-guide-to-woocommerce-taxes--cms-22060

And https://docs.woocommerce.com/document/configuring-woocommerce-settings/ for the default customer addresss

Default Customer Address

An online store owner is completely unaware about the location of any new customer who visits the store. The calculation of taxes becomes quite difficult at that time. This option lets a store owner to display prices by assuming a default location before any customer enters his actual address. You will select ‘Shop base address’ (instead of ‘No address’) in this case an automatic tax correction is applied once a customer enters his country as his base address.

Upvotes: 2

Related Questions