Closed bckpff closed 3 years ago
Hi @madhippieqq. Thank you for your report. To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, please, review the Magento Contributor Assistant documentation.
Please, add a comment to assign the issue: @magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.
:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
@magento give me 2.4-develop instance
Hi @madhippieqq. Thank you for your request. I'm working on Magento 2.4-develop instance for you
Hi @madhippieqq, here is your Magento instance.
Admin access: https://i-29740-2-4-develop.instances.magento-community.engineering/admin_75c5
Login: a749cc0b
Password: 070b466cba2a
Instance will be terminated in up to 3 hours.
Could reproduce this issue on 2.4-develop
We commited patch https://github.com/pixelhed/magento2/commit/25ea6caf9f64c9ad55e951c54bbb633b84f3dcc2 thanks to @pixelhed
This fixed the issue for us temporarily untill core fix is released.
I applied the same patch. This didn't work for me.
@madhippieqq how did you apply the patch? we had to make some addjustments to the patch file. Did you follow the instructions how to apply a patch in Magento 2? Then you would have to edit the patch file because the original file contains path of local core code. You have to adjust to composer vendor modules file path.
Note: this is a .diff file
diff --git a/Model/Sales/Total/Quote/CommonTaxCollector.php b/Model/Sales/Total/Quote/CommonTaxCollector.php
index c7cc4ded1bf0..cc37cba69ffe 100644
--- a/Model/Sales/Total/Quote/CommonTaxCollector.php
+++ b/Model/Sales/Total/Quote/CommonTaxCollector.php
@@ -596,8 +596,8 @@ protected function processProductItems(
$address = $shippingAssignment->getShipping()->getAddress();
$address->setBaseTaxAmount($baseTax);
$address->setBaseSubtotalTotalInclTax($baseSubtotalInclTax);
- $address->setSubtotal($total->getSubtotal());
- $address->setBaseSubtotal($total->getBaseSubtotal());
+ //$address->setSubtotal($total->getSubtotal());
+ //$address->setBaseSubtotal($total->getBaseSubtotal());
return $this;
}
https://devdocs.magento.com/guides/v2.4/comp-mgr/patching.html
@albsa Since it were only two changed lines , I just applied the changes to Model/Sales/Total/Quote/CommonTaxCollector.php on my local machine manually, cleared cache and generation folder and retried. The error still occurs on magento 2.3.5-p2.
Hi @engcom-Oscar. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
:white_check_mark: Confirmed by @engcom-Oscar
Thank you for verifying the issue. Based on the provided information internal tickets MC-37729
were created
Issue Available: @engcom-Oscar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@magento I am working on this
Hi @voleye! :wave:
Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team
command to join Contributors team.
@magento add to contributors team
Hi @voleye! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.
@magento I am working on this
@magento-engcom-team seems it is not a bug. Magento has an appropriate settings in Store->Configuration->Sales->Tax->Calculation Settings Apply Discount On Prices (Excluding Tax|Including Tax) and description: " Warning: To apply the discount on prices including tax and apply the tax after discount, set Catalog Prices to “Including Tax”. " So, if you would like to apply discount on a price value including tax then you have to make appropriate configuration in particular set Catalog Prices to “Including Tax”
@voleye but this issue is relating to a cart price rule for a fixed amount on order. Not related to specific product prices? I definitely think this is a bug. A few issues have raised now. https://github.com/magento/magento2/issues/28472 perhaps this one is related too? https://github.com/magento/magento2/issues/13392 I think it is difficult to evaluate the issue as tax has many variables dependent on user country. This is especially true when a merchant sells taxable and non-taxable goods in the same transaction; we cannot apply a simple 'workaround' by changing the discount gate amount to exclusive of tax.
For example - I have the following settings in Tax Configuration. My tax rate is 10%.
Now, I have created a cart price rule that gives $15.95 discount (the relevant shipping cost) to the cart when a customers cart totals $199 or more.
I think its important to note here that there is option for Subtotal Excl Tax or Subtotal. One would assume the latter is inclusive of tax.
Now, for simplicity sake I have added a taxable item to cart worth $10 (which is actually $9.09 excl tax + $0.91 tax). With a quantity of 20 of this item so the cart total is now $200. I then select the relevant shipping method as per cart price rule. NO DISCOUNT APPLIED: Now, I add two more of this product to the cart. Now my total is $220 (which includes $20.02 tax; $199.98 exclusive of tax). DISCOUNT IS APPLIED:
It seems Magento is using the price exclusive of tax to calculate whether the sales price rule applies. This is not consistent with the tax settings or the cart price rule settings. To the customer, it seems like we are lying or duping them with our cart price offer.
After applying the patch linked above: https://github.com/pixelhed/magento2/commit/25ea6caf9f64c9ad55e951c54bbb633b84f3dcc2
Now, I re-add the same product, quantity and select the relevant shipping method and the discount is applied correctly:
Perhaps this patch causes other issues for other users who don't include tax in catalog prices etc... I don't know. But for merchants that do, it is a problem. Thoughts?
@bernieu2 thank you for so detailed description, I will try to reproduce the issue again making all these settings!
The related internal Jira ticket MC-38939
was closed as Fixed
.
Fix for 2.4.x will be delivered soon in the scope of MC-37729
Preconditions (*)
Reproducing on 2.4-develop Magento ver. 2.3.5-p2 - upgraded from 2.3.5-p1 using composer
Steps to reproduce (*)
Expected result (*)
Actual result (*)
This pobably relates to: https://github.com/magento/magento2/issues/28472 The related PR did not fix my issue.
Edit: I could reproduce this behaviour on a fresh 2.4-develop instance.