Magento 1.9 Catalog Price Rules Not Working – Troubleshooting

catalog-price-rulesce-1.9.2.3discountmagento-1.9promotions

We are using Magento version 1.9.2.3. We have cart price rules setup based on user's group and product's custom attribute. It sometimes doesn't work. And I am not sure what the reason is. I can't really replicate the issue as it is on and off type of issue.

Users are complaining about it for not getting discounts and i can verify it form their order but if i manually add same order for the specific user then i see the discount.

Has any one experienced this issue. I will really appreciate your help on this.

Best Answer

Catalog price rules Need Cron jobs. install this extension and check whether cron is working or not. if it is working check your Default Store Timezone is matching your server timezone.

enter image description here

credits : @Alexei Yerofeyev

if both timings are same, than Yes, this is a bug in Magento (or some logic beyond my understanding). we had the same problem. When Magento displays products on frontend, it checks if there are catalog rules for this date. And the date used for this check is your local, so in our case it was GMT+5. However, when catalog rules are being applied, it uses GMT date. So that means that we were't able to apply rules until 5 AM.

The problem is in Mage_CatalogRule_Model_Action_Index_Refresh::execute() function. You will have to rewrite this function/class either in your extension, or via the local version of the file.

we replaced line 121:

$timestamp = $coreDate->gmtTimestamp('Today');

with this line:

$timestamp = Mage::app()->getLocale()->date(null, null, null, true)->get(Zend_Date::TIMESTAMP);

After that it worked for us.

if that also didt worked for you, than

using AOE scheduler extension, change catalogrule_apply_all cron expression from 0 1 * * * to 30 */6 * * * and it may work for you.

if possible check the order time that didt applied discount and you may need to find what is exact timings that price rules are not working. Temparary fix is clicking "Apply catalog rules " button again when it was not working.

Related Topic