Created
December 29, 2016 16:32
-
-
Save versedi/37e112aded5b83e36effdf4f3265b53c to your computer and use it in GitHub Desktop.
Activate coupons sale rules by specific expiration date.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$collection = Mage::getModel('salesrule/coupon')->getCollection()->addFieldToFilter('expiration_date', array('eq' => '2016-12-30 00:00:00')); | |
foreach($collection as $coupon) { | |
$rule = Mage::getModel('salesrule/rule')->load($coupon->getRuleId()); | |
$rule->setIsActive(true)->save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment