-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Coupon for single use can be used multiple times #38017
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
Comments
Hi @HenKun. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
@magento give me 2.4-develop instance |
Hi @HenKun. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
Hi @HenKun, here is your Magento Instance: https://e8d12c1de32a4407b2a6fa73cee90089.instances-prod.magento-community.engineering |
The issue can be reproduced on generated instance.
Nonetheless, the issue is reproduced under these conditions. Further orders (after both orders are processed) with the same coupon code fail, so it can be concluded the queue works, but is not fast enough. |
Hi @HenKun , I am also facing the same issue. Please let me know if you find any solution for this issue. Thanks in advance |
The problem won't be easy to solve. This needs to be done completely or at least partially synchronous. I hope Magento will care for this issue |
Hi @engcom-Dash. Thank you for working on this issue.
|
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://e8d12c1de32a4407b2a6fa73cee90089.instances-prod.magento-community.engineering |
Hi @HenKun .Thanks for reporting and collaboration. Verified the issue on Magento 2.4-develop instance and the issue is reproducible. Please refer the below screenshots. Order from browser 2 Coupon code usage |
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Once all required labels are present, please add |
Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Once all required labels are present, please add |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-9649 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Dash. Thank you for verifying the issue. |
@magento give me 2.4-develop instance |
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Dash, here is your Magento Instance: https://e8d12c1de32a4407b2a6fa73cee90089.instances-prod.magento-community.engineering |
@magento I am working on this |
…ed issue with multiple usage limited coupon by adding coupon usage validator to quote submitting
@engcom-Dash What is the status of this? Is a fix planned? |
The following patch seems to work:
I guess the original intention do you this async via queue is for very high volume shops? Maybe it could be made configurable or only be queued in such cases, where the usage is not limited. |
any updates on this? |
Hello all, I was just checking on this from an internal issue and it appears they have made adjustments to make the coupon usage update synchronously. For example in the 2.4.5-p11 tagged version, they include a reference to CouponUsageProcessor in the constructor and use the I had been checking this issue and just seeing that it was "open" instead of looking directly at the files. Is this sufficient or are there still timing issues with the implementation? |
Preconditions and environment
Steps to reproduce
Create a cart rule with coupon usage and usage per coupon = 1

Add fixed cart as Action

Generate coupon code (used is no, used times is 0)

Open browser 1, apply coupon code an go to last checkout page

Open browser 2 (or incognito tab), apply coupon code an go to last checkout page

Place order in browser 1 and 2 simultanously (a few seconds might be ok)
Both orders are successfull



Control coupn code usage. It is used and "times used" is 2

Expected result
Coupon can only be used for one order
Actual result
Coupon can be used multiple times, if fast enough
Additional information
Related:
https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/troubleshooting/miscellaneous/coupon-code-used-more-than-once-adobe-commerce.html?lang=en
#23907
#35077
In this case, the consumer is correctly set up, so the coupon code usage is raised correctly. However, due to the queue mechanism, this is not done fast enough, so a customer can place multiple orders with the same coupon code within the time period the system needs to raise the coupon usage.
This can be exploited by customers, e.g. if coupon codes are used as simple gift cards.
Maybe it isn't a good idea to use queues in this scenario where it relies on an immediate raise of the coupon code usage?
Or a coupon code should already be blocked when it is applied to the quote.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: