-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
issue/14056 - Coupon API not working for guest user #15320
issue/14056 - Coupon API not working for guest user #15320
Conversation
Hi @Hypo386. Thank you for your contribution. Please, consider to port this solution to 2.3 release line. |
@magento-engcom-team give me 2.3-develop instance |
Hi @pascalckunz. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @pascalckunz, here is your Magento instance. |
@magento-engcom-team give me 2.2-develop instance |
Hi @pascalckunz. Thank you for your request. I'm working on Magento 2.2-develop instance for you |
Hi @pascalckunz, here is your Magento instance. |
issue/14056 - Coupon API not working for guest user
#14056
Description
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