craftcms / commerce

Fully integrated ecommerce for Craft CMS.
https://craftcms.com/commerce
Other
226 stars 170 forks source link

[4.x]: Tax rate is calculated on shipping address, not on billing address #3197

Closed rauwebieten closed 1 year ago

rauwebieten commented 1 year ago

What happened?

Description

It seems the tax rate is calculated based on the submitted shipping address, and not on the billing address.

Steps to reproduce

I have setup my different tax rates and zones, as explained in the docs.

Expected behavior

When modifying my cart in the admin: When choosing a billing address, i expect the tax to be calculated. It is not being calculated, unless I choose a shipping address.

I understand that when templating the cart system, you can check the checkbox that says "same billing address as shipping". Then the calculation will be correct.

In our case, we're building a website with digital products. We do not need a shipping address configured in our cart/order. We can fix this for now by simply setting the shipping address equal to the billing address.

But... There is a case this way of working is not correct. (with physical products) As a customer, I can place an order from a company (in Belgium for example), and send it to a different shipping address (in France for example). I expect the the tax calculation to be based on the billing address (BE) and not on the french shipping address.

Craft CMS version

Craft Pro 4.4.14

Craft Commerce version

4.2.11

PHP version

8.1

Operating system and version

Debian

Database type and version

mariadb

Image driver and version

mysql

Installed plugins and versions

-

lukeholder commented 1 year ago

@rauwebieten would this setting be the solution?

https://craftcms.com/docs/commerce/4.x/config-settings.html#usebillingaddressfortax

rauwebieten commented 1 year ago

Ok, great! That would be the solution I guess. Will test later.

This should be included in the docs/guides :)

Thanks

rauwebieten commented 1 year ago

@rauwebieten would this setting be the solution?

https://craftcms.com/docs/commerce/4.x/config-settings.html#usebillingaddressfortax

Tested, works perfectly, thanks.