-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
[Forwardport] Coupon API not working for guest user #16562
[Forwardport] Coupon API not working for guest user #16562
Conversation
Hi @gelanivishal. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @gelanivishal Thanks |
Hi @ishakhsuvarov Thank you. |
Hi @orlangur, thank you for the review. |
Hi @gelanivishal. Thank you for your contribution. |
Original Pull Request
#15320
issue/14056 - Coupon API not working for guest user
#14056
Description
This is a forward port for the following PR: #15320
I think everything is fine with the code. Reason is that programmers don't use API properly. With 1 step when cart is being created it's already wrong because quote doesn't contain proper store id. When cart is being added by API it has store id 0. So instead of adding by
/rest/V1/guest-carts (which is standard in swagger)
we should use
/rest/default/V1/guest-carts
By using store code in URL we provide store id to quote.
Then coupon code added by API works like charm.
So reason is some kind of ignorance. We've decided to provide better validation message while adding coupon code to inform programmer that he has wrong quote and that problem is rather there.
I think that some example would be useful in API documentation to show how to use API properly.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist