You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating new cart price rule with specific coupon sets exipiration_date for coupon to today causing coupons to stop working after midnight (takes in account only Y-m-d)
Magento CE and EE 2.1.2, nginx, php7
Steps to reproduce
Create cart price rule
Leave "From" and "To" dates empty (they are not required)
expiration date should be NULL therefore never expires.
Actual result
Cart price rule and coupon expiration date is today's date and the coupon is not working after midnight.
This problem is a blocker for enterprise edition because coupon and cart rule state is managed by staging module. This means that after creating or editing cart price rule it will work only for 1 day without direct access to a database and editing salesrule_coupon table directly by deleting expiration_date. there is no way to change expiration date through an admin panel.
Some info from debugging:
file: vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php
Zend_Filter_Input returns empty to_date and from_date values as today's date.
after removing this code coupon expiration date still is set as today
I was able to trace it till vendor/magento/module-sales-rule/Model/ResourceModel/Coupon.php line 37. in _beforeSave() method, $object already have expiration_date and I was not able to backtrace it further where empty value is transformed to today's date.
The text was updated successfully, but these errors were encountered:
kandrejevs
changed the title
Cart price rule edit sets expiration date to today
Cart price rule save/edit sets coupon expiration date to today
Oct 21, 2016
Creating new cart price rule with specific coupon sets exipiration_date for coupon to today causing coupons to stop working after midnight (takes in account only Y-m-d)
Magento CE and EE 2.1.2, nginx, php7
Steps to reproduce
for rule settings please reference this screenshot: http://i.imgur.com/cwx8WN2.png
Expected result
Actual result
This problem is a blocker for enterprise edition because coupon and cart rule state is managed by staging module. This means that after creating or editing cart price rule it will work only for 1 day without direct access to a database and editing
salesrule_coupon
table directly by deletingexpiration_date
. there is no way to change expiration date through an admin panel.Some info from debugging:
file:
vendor/magento/module-sales-rule/Controller/Adminhtml/Promo/Quote/Save.php
Zend_Filter_Input returns empty to_date and from_date values as today's date.
after removing this code coupon expiration date still is set as today
I was able to trace it till
vendor/magento/module-sales-rule/Model/ResourceModel/Coupon.php
line 37. in_beforeSave()
method, $object already have expiration_date and I was not able to backtrace it further where empty value is transformed to today's date.The text was updated successfully, but these errors were encountered: