Checkout: adding coupon codes in the checkout process causes 'Request does not match any route' error message #10035
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
Uh oh!
There was an error while loading. Please reload this page.
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
Steps to reproduce
Expected result
Actual result
'Request does not match any route' error messages shown in frontend.
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
The text was updated successfully, but these errors were encountered: