Every time I update Magento I have got this probem: I have to manually applicate the catalog price rule, otherwise they don't work.

I have done the following changes:
File app/Mage.php:

date_default_timezone_set('Europe/Rome');//Instead of UTC

File Mage/CatalogRule/Model/Action/Index/Refresh.php(local copy and none):

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

with this line:

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

Source: https://stackoverflow.com/questions/25280095/magento-catalog-price-rule-disappears-at-night

Reading this question: Catalog price rule from today does not apply

The time zone set inSystem/Configuration/Genral/Locale options is correct, but if I run this script:


echo date('Ymd His', Mage::getModel('core/date')->gmtTimestamp('today'));

it output 2015-11-07 23:00:00 instead of 2015-11-08 11:19:ss, basically a gap of twelve hours.

Cron Job Setting

File: /app/code/core/Mage/CatalogRule/etc/congif.xml

            <cron_expr>0 1 * * *</cron_expr>

File /app/code/core/Mage/Catalog/etc/config.xml

            <cron_expr>0 2 * * *</cron_expr>

Value in cronjob setting: Cron setting
Using this:

date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));

it outputs the time without considering the daylight save, basically one hour in advance

Reverting the changes in app/Mage.php: has solved the daylight save problem


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.