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

Magento 2.2.6 coupon codes don't work anymore #18183

Closed
Cristiano81 opened this issue Sep 21, 2018 · 58 comments
Closed

Magento 2.2.6 coupon codes don't work anymore #18183

Cristiano81 opened this issue Sep 21, 2018 · 58 comments
Assignees
Labels
Component: SalesRule Event: dmcdindia1 Event: squashtoberfest Fixed in 2.3.x The issue has been fixed in 2.3 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.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

@Cristiano81
Copy link

Cristiano81 commented Sep 21, 2018

Preconditions

  1. Magento 2.2.6
  2. Cart price rule based on coupon code

Steps to reproduce

  1. Create a cart price rule with specific coupon with date from 2018 to 2088
  2. Try add the coupon to the cart

Expected result

  1. The coupon has been successfull applied to the cart

Actual result

  1. Every coupon code result invalid
@magento-engcom-team
Copy link
Contributor

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

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • 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 $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

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

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 21, 2018
@Cristiano81
Copy link
Author

In 2.2.5 the coupon code work

@Cristiano81
Copy link
Author

@magento-engcom-team give me 2.2.6 instance

@magento-engcom-team
Copy link
Contributor

Hi @Cristiano81. Thank you for your request. I'm working on Magento 2.2.6 instance for you

@magento-engcom-team
Copy link
Contributor

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

@Cristiano81
Copy link
Author

yes i can reproduce the issue on vanilla magento

@Cristiano81
Copy link
Author

This maybe be usefull, when i try to apply the coupon code, i received this error on chrome console:
jquery.js:10254 PUT https://i-18183-2-2-6.engcom.dev.magento.com/rest/default/V1/guest-carts/BWM5XQCXhnzdxK9njKSP2cL611NFTmcG/coupons/TEST2018 404 (Not Found)
send @ jquery.js:10254
ajax @ jquery.js:9738
put @ storage.js:62
(anonymous) @ set-coupon-code.js:33
apply @ discount.js:41
(anonymous) @ knockout.js:3863
dispatch @ jquery.js:5226
elemData.handle @ jquery.js:4878

@kunj1988
Copy link
Contributor

@Cristiano81, I have tried with vanilla Magento 2.2.6 and it is working for me, Please provide more details.

@Cristiano81
Copy link
Author

@magento-engcom-team give me 2.2.6 instance

@magento-engcom-team
Copy link
Contributor

Hi @Cristiano81. Thank you for your request. I'm working on Magento 2.2.6 instance for you

@magento-engcom-team
Copy link
Contributor

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

@Cristiano81
Copy link
Author

@kunj1988 thank you,
i just created a test product with price 100$
image

after that i created a new coupon with this attribute:

image
image
image

after i add the test product in cart and try to apply the coupon discount, this is the result:
image

maybe you can tell me your coupon configuration if it works

@hostep
Copy link
Contributor

hostep commented Sep 22, 2018

@Cristiano81 : the coupon codes in your screenshot don't match: TEST20118 vs TEST2018, please make sure they are the same ;)

@Cristiano81
Copy link
Author

Cristiano81 commented Sep 22, 2018

ops you are right :P but even if they are the same it doesn't work,
please try on the active vanilla magento

@hostep
Copy link
Contributor

hostep commented Sep 22, 2018

Ok, I was able to reproduce, and also found out why.

It has to do with the "to date". In your example, you put it in the year 2088.
When I first tested, I just used 2018 and it worked perfectly fine.

After some playing around, it looks like the limit is 20 years, the year 2037 works, but the year 2038 no longer works.

So this is pretty strange.
You say it worked before on Magento 2.2.5? Also with the year 2088?
If yes: then you've found a new bug, but the fix is pretty easy. But I still consider it a bug if it worked in Magento 2.2.5, because this is kind of unexpected.

@hostep
Copy link
Contributor

hostep commented Sep 22, 2018

Hmm, just tested on Magento 2.2.5, it has the exact same problem, so it's not a new bug in 2.2.6. But it's certainly a problem.

@Cristiano81
Copy link
Author

Thank you for your support!
I can tell y the same, in 2.2.5 it didn't work with 2088, BUT it worked with blank "to date" , it does not in 2.2.6 .
I'm going to set an early "to date" thank y again

@hostep
Copy link
Contributor

hostep commented Sep 22, 2018

Hmm, I can not confirm the problem with the blank "to date".
See the test instance, I've added a new coupon with code TEST2020 with a blank "to date". And it works, maybe double check if I've missed something?

coupon-settings

coupon-results

@kunj1988
Copy link
Contributor

kunj1988 commented Sep 24, 2018

@Cristiano81, yes, I got the same error while adding Date with 09/30/2088 in To field otherwise working fine. It works with max 20 years difference between From and To field.

@ghost ghost self-assigned this Sep 24, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 24, 2018

Hi @engcom-backlog-nazar. 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: 👇

  • 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 G1 Passed will be added to the issue automatically. Please, edit issue description if needed, until label G1 Passed appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add G2 Passed 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

  • 6. Add label acknowledged once verification is complete.

  • 7. Make sure that automatic system confirms that report is acknowledged.

@ghost ghost added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Sep 24, 2018
@ghost
Copy link

ghost commented Sep 24, 2018

Hi @hostep so this is bug ? or we can just leave field empty?

@ghost ghost added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Sep 24, 2018
@kunj1988
Copy link
Contributor

kunj1988 commented Sep 24, 2018

In my case, While we add To date more than 20 years Magento adding 0000-00-00 00:00:00 value in expiration_date field.
select salesrule_coupon adminer

@hostep
Copy link
Contributor

hostep commented Sep 24, 2018

@engcom-backlog-nazar: the fact that the 20 year problem exist is a bug, but it seems to have already existed since Magento 2.2.0 at least (haven't tested further back).

I'm still curious about the exact problem of @Cristiano81 where it worked on 2.2.5 but no longer on 2.2.6, that part hasn't been discovered yet I believe.

@Cristiano81
Copy link
Author

Cristiano81 commented Sep 24, 2018

@hostep the fact is very curious.
I opened this issue because we had a Magento 2.2.2 with a coupon with these settings:
image
image
image

After upgrade from 2.2.2 to 2.2.5 and after to 2.2.6 this coupon stopped work.
But on our test enviroment where there is the 2.2.5 version of Magento the same coupon works perfectly.
On saturday after some try with the date it starts work also on 2.2.6 ...

@ghost ghost added 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 Sep 24, 2018
@vdBrandtMedia
Copy link

I have encountered the same issue on 2.2.5, checked the date_to value in the salesrule table but it gives a correct value of 2019-11-26

@shikhamis11 shikhamis11 self-assigned this Feb 12, 2019
@magento-engcom-team
Copy link
Contributor

Hi @shikhamis11. 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-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!

  • 3. 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

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

@scottsb
Copy link
Member

scottsb commented Mar 13, 2019

I agree with @konarshankar07 that the best/correct solution here is to change the expiration column type to a DATETIME instead of TIMESTAMP.

@henryktews henryktews self-assigned this Mar 21, 2019
@magento-engcom-team
Copy link
Contributor

Hi @henryktews. 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-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!

  • 3. 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

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

@henryktews henryktews removed their assignment Mar 21, 2019
@thomas-avada
Copy link

My client encountered this issue for one time. As far as I can tell, it is because the server configuration does not allow PUT, PATCH and DELETE request. You should contact your server guy on this and try my approach to enable all of the above request verbs.

@this-adarsh
Copy link
Contributor

I am working on this at #dmcdindia19

@magento-engcom-team
Copy link
Contributor

@this-adarsh thank you for joining. Please accept team invitation here and self-assign the issue.

@m2-assistant
Copy link

m2-assistant bot commented May 4, 2019

Hi @this-adarsh. 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-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!

  • 3. 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

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

@this-adarsh
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

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

@magento-engcom-team
Copy link
Contributor

Hi @Cristiano81. Thank you for your report.
The issue has been fixed in #22718 by @this-adarsh in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.3 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label May 29, 2019
magento-engcom-team added a commit to okorshenko/magento2 that referenced this issue May 29, 2019
…8183 magento#22718

 - Merge Pull Request magento#22718 from this-adarsh/magento2:issue-18183
 - Merged commits:
   1. e965f0c
@ashvinimarwal
Copy link

The issue still exists in Magento 2.3.2.tried to fix it using by change timestamp to datetime in db_schema.xml file

<column xsi:type="timestamp" name="expiration_date" on_update="false" nullable="true"
                comment="Expiration Date"/>
        <column xsi:type="smallint" name="is_primary" padding="5" unsigned="true" nullable="true" identity="false"
                comment="Is Primary"/>
        <column xsi:type="timestamp" name="created_at" on_update="false" nullable="true"
                comment="Coupon Code Creation Date"/>

But still not fixed.

@SrinivasChukka
This comment has been minimized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: SalesRule Event: dmcdindia1 Event: squashtoberfest Fixed in 2.3.x The issue has been fixed in 2.3 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.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