Magento2: On checkout page coupon code validation message break when enter coupon like "test/"

Created on 20 Feb 2019  路  30Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3.x

Steps to reproduce (*)

  1. Create a new Cart Price Rule from _Admin > Marketing > Cart Price Rule_
  2. Select the next setting and value
    -- Coupon = Specific Coupon
    -- Coupon Code = test/
  3. Go to Storefront as Guest or Registered user
  4. Add test product to Shopping Cart
  5. Go to Shopping Cart page
  6. Click "Apply Discount Code" and apply coupon "test/" (Discount Code is applied successfully)
    Screenshot from 2020-08-05 17-56-44
  1. Click "Apply Discount Code" again and "Cancel Coupon"
  2. Proceed to Checkout now(without cupon)
  3. Fill all required information for Shipping Address steps and go NEXT
  4. On Payment Method steps, Click "Apply Discount Code" and apply coupon "test/"

Expected result (*)

  • The coupon "test/" is successfully applied in the same way as from the Shopping Cart page

Actual result (*)


Screenshot from 2020-08-05 17-57-36

Frontend Checkout Clear Description Confirmed Format is valid Ready for Work P3 Reproduced on 2.2.x Reproduced on 2.3.x Reproduced on 2.4.x S3 Ready for Triage

Most helpful comment

Definitely looks like it @ihor-sviziev, I'm using nginx locally, so setting AllowEncodedSlashes should fix this for apache I think 馃憤

All 30 comments

Hi @mageprince. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [x] Summary of the issue
  • [x] Information on your environment
  • [x] Steps to reproduce
  • [x] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@mageprince do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [x] yes
  • [ ] no

Hi @krishprakash. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [x] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [x] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • _Next steps are available in case you are a member of Community Maintainers._

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

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

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

Hi @krishprakash, here is your Magento instance.
Admin access: https://i-21353-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

Hi @shikhamis11. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [x] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • _Next steps are available in case you are a member of Community Maintainers._

  • [ ] 6. Add label Issue: Confirmed once verification is complete.

  • [ ] 7. Make sure that automatic system confirms that report has been added to the backlog.

also at backend it is allowed to create coupon code like test/ . Coupon is being applied from checkout cart page but not from payment step

:white_check_mark: Confirmed by @shikhamis11
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-98339, MAGETWO-98340 were created

Issue Available: @shikhamis11, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._

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

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

Hi @Shubham-Webkul, here is your Magento instance.
Admin access: https://i-21353-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@shikhamis11 So, we can create coupons that contain or end in "/" in the backend, but then not apply them in the frontend? Then we should fix the application of code, or completely block creation of such coupons.

Hi @josefbehr. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


Hi @josefbehr
I think that must be completely blocked but
I will discuss this with Magento members and let you know the exact fix for this

@shikhamis11 great, thank you. Please get back to me, if you need anything or when a new PR is created :)

Hello @mageprince @shikhamis11 @josefbehr

Thank you for contribution and collaboration!

We have discussed the expected result for this case internally

In general:

  • coupon code with symbols such as "/" should be valid.
  • It should be allowed to create it from the Admin side(current behavior)
  • It should be possible to apply it in each place on Storefront(cart page, checkout, etc)

So, should be fixed checkout flow to allow such coupons.

Unfortunately, fix like add validation on Admin side is not acceptable because it potentially could affect all merchants who already created and sent coupons with "/" or other special characters

I will update the description and expected result to reflect it

@magento-engcom-team @ihor-sviziev seems the issue is solved on 2.4-develop:
image

Hi @shikhamis11 could you confirm that issue is fixed and close the issue?

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

Hi @ihor-sviziev I checked as per explanation of @sdzhepa coupon code with / is valid and it should be working at every place at checkout as well as on shopping cart ..
I checked on magento 2.4-develop instance It seems working at checkout cart page but not on checkout page .. so this issue persist at magento 2.4-develop instance also

@shikhamis11 thank you!

@Bartlomiejsz looks like this issue still there

@ihor-sviziev @shikhamis11 that's weird, you can see on image attached in my previous comment that on my local which is clean fork of 2.4-develop this request was finished successfully and coupon code was added. On github test instance it ends with 404. If I'll be able to I'll try to verify what can be a difference here somewhere in future

@Bartlomiejsz It might be related to apache vs nginx configuration.
On test instances we have apache and seems like it is configure incorrectly.

I think it might be related to following:
https://github.com/magento/magento2/issues/13343#issuecomment-362783825
https://github.com/magento/magento2/issues/8615#issuecomment-588980345

Definitely looks like it @ihor-sviziev, I'm using nginx locally, so setting AllowEncodedSlashes should fix this for apache I think 馃憤

Hi @slavvka @sidolov @lenaorobei @naydav,
Could you help to resolve incorrect Apache configuration of test instances?

@Bartlomiejsz in addition to that I reported issue to describe needed configuration in the devdocs https://github.com/magento/devdocs/issues/6689

Hi @ihor-sviziev. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:

  • [ ] 1. Add/Edit Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
  • [ ] 2. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.


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

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

Hi @nwmagento, here is your Magento instance.
Admin access: https://i-21353-2-4-develop.instances.magento-community.engineering/admin_ebfd
Login: d30578be Password: 06cde9c69b47
Instance will be terminated in up to 3 hours.

Hi @mageprince,
I'm closing this issue as the issue was in the web server configuration. This info was added to dev docs:
https://devdocs.magento.com/guides/v2.3/install-gde/prereq/apache.html#apache-required-directives

Was this page helpful?
0 / 5 - 0 ratings