Skip to content
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

Merged
merged 2 commits into from
Jun 7, 2018
Merged

issue/14056 - Coupon API not working for guest user #15320

merged 2 commits into from
Jun 7, 2018

Conversation

marcin-dykas
Copy link

@marcin-dykas marcin-dykas commented May 18, 2018

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)

  1. Coupon API not working for guest user #14056: Coupon API not working for guest user

Manual testing scenarios

  1. Create guest cart by API
  2. Add product to cart by API
  3. Create coupon and rule in admin panel
  4. Add coupon to cart by API
  5. See exception "Coupon code is not valid"

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
morozov Sergei Morozov
@dmanners dmanners added the Event: WroCD Contribution day in Wro label May 18, 2018
@magento-engcom-team
Copy link
Contributor

Hi @Hypo386. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.6 release.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@pascalckunz
Copy link

@magento-engcom-team give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @pascalckunz. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @pascalckunz, here is your Magento instance.
Admin access: https://i-15320-2-3-develop.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@pascalckunz
Copy link

@magento-engcom-team give me 2.2-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @pascalckunz. Thank you for your request. I'm working on Magento 2.2-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @pascalckunz, here is your Magento instance.
Admin access: https://i-15320-2-2-develop.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants