-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: QuoteComponent: TaxIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentgood first issue
Description
Preconditions (*)
- Magento CE 2.3.1 without sample data is installed.
Steps to reproduce (*)
- Configure tax zones and rates as follows:
- Configure tax rules as follows:
- Configure customer groups as follows:
- Add a test product:
- Set the default country (stores>configuration>general>general) to the Netherlands (other european countries should have the same problem)
- Configure store information as follows (Make sure you use a valid european Vat number and country combination. The vat number should not contain the country prefix):
- Configure customer configuration (stores>configuration>customers>customer configuration) as follows:
- Configure Tax (stores>configuration>sales>tax) as follows:
- Create an account in the frontend with (make sure you use a valid vat number country combination according to the tax rule setup earlier (BE vat number). The vat number should not contain the country prefix):
- Enter a default billing address (make sure the vat number is the same one used in the previous step and the country should be the same as the origin of the vat number (BE in this case)):
- Go to the product page of the product you added.
- The price it shows should not contain any tax for Belgium vat validated customers (this still works as long as you have never added a product to your cart before).
- Add the product to your cart.
- Open the shopping cart
Expected result (*)
- The shopping cart shows the same price as the catalog (no tax added to the product)
Actual result (*)
- The shopping cart shows the price with the default BE tax (10%) added.
- From this point on the catalog also shows the wrong price.
Workaround
Adding the following 2 lines to:
vendor/magento/module-quote/Observer/Frontend/Quote/Address/CollectTotalsObserver.php
Starting from line 105:
/** try to get data from customer if quote address needed data is empty */
if (empty($customerCountryCode) && empty($customerVatNumber) && $customer->getDefaultShipping()) {
$customerAddress = $this->addressRepository->getById($customer->getDefaultShipping());
$address->setCountryId($customerAddress->getCountryId()); // ADD THIS LINE
$address->setVatId($customerAddress->getVatId()); // ADD THIS LINE
$customerCountryCode = $customerAddress->getCountryId();
$customerVatNumber = $customerAddress->getVatId();
}
Seems to have fixed the issue
Metadata
Metadata
Assignees
Labels
Component: QuoteComponent: TaxIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchCannot reproduce the issue on the latest `2.4-develop` branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentgood first issue