Magento – Catalog price rule doesn’t apply if the date is set to today

catalog-price-rulesce-1.9.2.4magento-1.9

I'm trying to set scheduled catalog price rules in my store.

When applying a catalog price rule to my store it does not work when the starting date is set to the current day.

It does work when I subtract one day of the current date.

Examples (using 2016-11-21 as the current date):

  • From: 2016-11-21. Doesn't work.
  • From: 2016-11-20. Does work.

Is this supposed to happen? If not, what could be the issue?

I'm running Magento CE 1.9.2.4.

Thank you!

Best Answer

Problem in this instance is on these lines

$fromTime = (int) strtotime($rule->getFromDate());
$toTime = (int) strtotime($rule->getToDate());

Update the two lines to

$fromTime = (int) Mage::getModel('core/date')->gmtTimestamp(strtotime($rule->getFromDate()));
$toTime = (int) Mage::getModel('core/date')->gmtTimestamp(strtotime($rule->getToDate()));

You should add class to override if you can.

Please check more detail here: https://magento.stackexchange.com/a/82394

Related Topic