
Description
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
- Magento 2.1.0
- PHP Version 7.0.14
Steps to reproduce
-
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. -
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.