0

We are running Magento community version 1.8.1.0.

In the default config, the timezone is set to China Standard Time(Asia/Shanghai). In one of our stores (call it Store A), the timezone is set to Pacific Standard Time (America/Los_Angeles).

For some reason, on March 12 2018 (China Standard Time), the discounts in Magento admin for Store A (Pacific Standard Time) have disappeared. We believe this has something to do with the daylight savings time changes on March 11 2018 (Pacific Standard Time).

Is there any way to force the discounts to appear in Magento admin for Store A?

1 Answer 1

0

Try to reapply the rules for the discounts on Store A. I don't know if it's the same case here, but there is a bug in Magento 1 about catalog price rules.

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 your case GMT+5. However, when catalog rules are being applied, it uses GMT date. So that means that you aren'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.

You have to replace line 121:

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

with this line:

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

You can find the original answer here.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.