-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ECP-9376] Fix checkout for configurable products when product is in low stock #62
Conversation
Hello @pmarjan-onestic, Thank you for providing the fix. Is this PR ready to be reviewed? If so, could you please add a brief description about the fix and how these changes lead us to the solution? Best Regards, |
hi @candemiralp
Marc's suggestion was something like: _"My observation is that since the configuration is only needed to populate data in the payment block, it may be sufficient to fetch only the specific configurations required for those blocks, rather than retrieving all configurations." And the PR is now following this idea, practically introducing "Adyen\Hyva\Model\CompositeConfigProvider" instead of "Magento\Checkout\Model\CompositeConfigProvider". The former is custom configured in di.xml to include config provider that are relevant to the adyen usage, making it more targeted and probably more preformance oriented at the same time. Let me know please if any questions. |
Hello @pmarjan-onestic, Thank you for providing a fix for this issue. We are still testing it and this PR will be merged after testing. Best Regards, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the approach of the custom ConfigProvider. I'm having the issue you mentioned as well. Will check if that is solved with this PR. Would be really awesome to get this working properly.
Quality Gate passedIssues Measures |
Summary
For configurable products, shoppers can now select a shipping method and complete checkout when the product is in low stock.
In the compatibility module, there are two calls to
CartItemPersister
, which processesBuyRequestData
differently each time:BuyRequestData
is returned as a float (indicating, possibly, a single unit or specific quantity).BuyRequestData
is returned as an object (indicating a detailed configuration request, such as specific product options or custom data).When
BuyRequestData
is treated as an object in the second request, Magento’sQuote.php
interprets this as a full update request for the cart. It tries to add more of the product to the cart and exceeds the available stock, which triggers an out-of-stock exception.This PR introduces the
CompositeConfigProvider
that includes all necessary configuration providers and avoids unnecessary processing that may interfere with cart items or stock levels.Tested scenarios
When checking out with a configurable product:
Fixes #59