Created
July 21, 2014 14:33
-
-
Save fballiano/21fe55fe585271c36ccb to your computer and use it in GitHub Desktop.
Apply promotion rules, for Magento EE 1.13, CE 1.8
This file contains 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 | |
require_once 'app/Mage.php'; | |
ini_set('display_errors', 1); | |
Mage::setIsDeveloperMode(true); | |
umask(0); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); | |
try { | |
Mage::getModel('catalogrule/rule')->applyAll(); | |
Mage::getModel('catalogrule/flag')->loadSelf() | |
->setState(0) | |
->save(); | |
Mage::app()->removeCache('catalog_rules_dirty'); | |
echo Mage::helper('catalogrule')->__('The rules have been applied.'); | |
} catch (Exception $e) { | |
echo Mage::helper('catalogrule')->__('Unable to apply rules.'); | |
print_r($e); | |
print_r($e->getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment