Magento2: Error: The coupon code "XXX" is not valid. Due to expiration date changed with current date while save coupon from admin.

Created on 17 Jan 2017  路  5Comments  路  Source: magento/magento2

When we create any new coupon from: Admin->MARKETING->Cart Price Rules
From next day of coupon creation when we create new coupon it throws error in shopping cart page.
As per our observation we found that generally its happening due to "expiration_date" is not updating properly while update another time from backend.
Each time we update the Coupon from backend then in this related db table salesrule_coupon its update the "expiration_date" with current date even though we have previously set the different from start and end schedule date. So that from next time/day system throws the error as "The coupon code "XX" is not valid." in frontend.

Preconditions


  1. Magento 2.1.0
  2. PHP Version 7.0.14

Steps to reproduce

  1. To Create A New Coupon:
    Go to: Admin->MARKETING->Cart Price Rules
    Create A New Cart Price Rules
    Set Coupon : Specific Coupon
    Save Coupon.
    Go to frontend in another day and use coupon in cart page.

  2. To Update Existing Coupon:
    Go to: Admin->MARKETING->Cart Price Rules
    Select our existing cart price rules and edit it
    Just Click on Save
    Go to frontend in another day and use coupon in cart page.

Expected result

While create new cart rule/coupon system should provide feature to set Expiration Date.
After second time update any coupon from admin previous expiration date(if set) should not override in `salesrule_coupon` table.
Please do suggest how to fix it.

Actual result

After create New Coupon, that day from frontend when we use that coupon code in shopping cart page then it works fine. But in another day it throws error i.e. "The coupon code "XX" is not valid."
When we go to Admin And Re Save/Update that coupon/rule then again it works ok.
But again from another day it doesn't works.

Tax Fixed in 2.2.x Format is valid needs update bug report

Most helpful comment

I just searched for a similar issue and opened three Github issues in a row. All of them were closed with no result because the issue itself was not well formatted or the person who submitted the issue didn't answer in time. IMHO this is just kind of a ticket burning, that helps no one but the KPI's...

All 5 comments

Have the same issue. Any fix for this?

@saroj2jcommerce In this case, are you leaving the from/to fields blank? If so, then this is a duplicate of #6122, which already has a fix, but it hasn't been released yet.

Hi @scottsb , yes #6122 this is the similar case we have. I hope Magento will soon release this fix.

@saroj2jcommerce is this issue still actual?
Could you confirm if is is still reproduces in ver. 2.1.7?

I just searched for a similar issue and opened three Github issues in a row. All of them were closed with no result because the issue itself was not well formatted or the person who submitted the issue didn't answer in time. IMHO this is just kind of a ticket burning, that helps no one but the KPI's...

Was this page helpful?
0 / 5 - 0 ratings