Description
Describe the bug
As noted in #7577 (comment), we have a fundamental problem calculating taxes for virtual products in Express Checkout. The problem happens because all the payment data is loaded when the page is rendered, so unless the customer is logged in, we have no data about their billing or shipping address. This data is only updated subsequently when we need to calculate the shipping fee, and since virtual products do not require shipping, the tax amount will not be updated.
In this issue we must look for a way to resolve this and calculate taxes correctly.
One idea I had is to always ask for a shipping address when using Apple Pay or Google Pay, even for products that don't require shipping.
The solution might be affected by #8297
To Reproduce
- Go to the taxes settings and create different Taxes zones
- On a new window, as a guest, clear all your cookies and local storage and use Apple Pay / Google Pay to pay for a virtual product
- Experiment with different settings for "Calculate tax based on" (Customer shipping address / Customer billing address / Shop base address)
Actual behavior
Tax calculation is inconsistent
Screenshots
Apple Pay modal | Price changed after confirmed |
---|---|
![]() |
![]() |
From checkout select billing country US | See Apple Pay modal with US tax price | After confirming, it changed to Brazil because of the card |
---|---|---|
![]() |
![]() |
![]() |
Expected behavior
Tax calculation should be correct
Additional context
7859784-zd-a8c
Activity