Open m2-assistant[bot] opened 1 year ago
Hi @engcom-Hotel. 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:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @fredden,
Thanks for the report and collaboration!
We have tried to reproduce the issue in Magento 2.4-develop branch but it seems the issue is not reproducible for us.
We have tried to follow the steps mentioned in the main description. For reference, we are attaching the plugin made by us in order to reproduce the issue. Magz.zip
We have made after plugin on Magento\Quote\Model\Quote
, and for us Gift Card is applying correctly.
Gift Card
Checkout Page
Let us know in case we have missed anything.
Thanks
This issue is automatically created based on existing pull request: magento/magento2#36475: Ensure Quote::collectTotals() correctly handles recursion
Description
We have written a plug-in for a shipping method. Our plugin requires access the quote object to perform its business logic. We get a reference to the current quote object by calling
Magento\Checkout\Model\Session::getQuote()
. This works correctly and we get a reference to the quote object and can perform the required actions.Within
Magento\Checkout\Model\Session::getQuote()
, there is a call to$quote->collectTotals()
. When this runs via our plug-in, Magento ends up calling$quote->collectTotals()
within an existing call to$quote->collectTotals()
(recursion). This becomes a problem when we introduce gift cards, which is a feature of Adobe Commerce. Because we are applying the gift cards each time$quote->collectTotals()
is called, but the second time around the gift cards are already 'used', so they do not get applied to the$quote
, and therefore disappear from the checkout.Manual testing scenarios
Preconditions:
Magento\Checkout\Model\Session::getQuote()
Steps to reproduce:
Contribution checklist