Skip to content

Checkout: adding coupon codes in the checkout process causes 'Request does not match any route' error message #10035

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

Closed
jhruehl opened this issue Jun 23, 2017 · 4 comments
Labels
bug report Component: Tax Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@jhruehl
Copy link
Contributor

jhruehl commented Jun 23, 2017

If one adds a coupon code starting with a hashtag '#' during the last step of the checkout process (not in the cart view itself), one gets the error message 'Request does not match any route' instead of the typical 'Coupon applied/Coupon invalid' messages.

Preconditions

  1. Magento 2.1.7
  2. PHP Version 7.0.17
  3. MySQL Version 5.6.34

Steps to reproduce

  1. Open the payment page of the checkout process, where you can add coupons (bug doesn't occur in the cart view itself)
  2. Add random coupon code starting with a hashtag '#'
  3. Click 'apply coupon'

Expected result

  1. standard success/error frontend messages 'coupon applied/invalid'.

Actual result

'Request does not match any route' error messages shown in frontend.

checkout_coupon_notice

Cause

The coupon code isn't correctly encoded in
/vendor/magento/module-checkout/view/frontend/web/js/model/resource-url-manager.js,
so before the ajax call happening the following piece of code in require.js removes the complete coupon code from the request URL:

"// Remove hash character (#7531: and string promotion)
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
// Handle falsy url in the settings object (#10093: consistency with old signature)
// We also use the url parameter if available
s.url = ( ( url || s.url || ajaxLocation ) + "" )
.replace( rhash, "" )
.replace( rprotocol, ajaxLocParts[ 1 ] + "//" );"

Patch

bugfix.txt

@AlexWorking
Copy link

Hello @jhruehl. Based on Your issue an internal ticket MAGETWO-70415 has been created. You'll be informed as the bug is fixed. Thanks for applying.

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 6, 2017
@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Tax Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed G1 Passed labels Sep 5, 2017
@magento-engcom-team magento-engcom-team added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 28, 2017
@magento-engcom-team
Copy link
Contributor

@jhruehl, thank you for your report.
We've created internal ticket(s) MAGETWO-80388 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 11, 2017
@RomaKis
Copy link
Contributor

RomaKis commented Nov 14, 2017

It is fixed in fb84267.

@magento-engcom-team magento-engcom-team added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Aug 20, 2018
@magento-engcom-team
Copy link
Contributor

@jhruehl We are closing this now per comment above. Please use that commit as a reference if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Tax Fixed in 2.2.x The issue has been fixed in 2.2 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

6 participants