Magento – Catalog price rule stops at midnight

catalog-price-rulesee-1.12

I have a catalog price rule for a group of products with start date 25/06/14 and end date 30/06/14. This rule stops working at midnight 29/06/14. This happens every weekend for campaigns that should be available until monday evening. Cron is running every minute. Anyone have a clue why they stop working a day in advance?

Best Answer

I had a lot of issues with the catalog price rules reindexing before.
My latest solution (that seams to work) was to change the hour when the cron for reindexing of catalog rules run.
Here is why.
I'm using a time zone with GMT+2.
The default cron is set to run at 1.00.
So I put a log to see when the cron starts and when it ends.
My surprise was to see the following:

2014-06-06T23:00:02+00:00 DEBUG (7): Start daily update
2014-06-06T23:00:05+00:00 DEBUG (7): End daily update

So the hour that was logged was the GMT hour (23.00).
And the cron calculates the dates to for which the reindex should be done like this:

$fromDate = mktime(0,0,0,date('m'),date('d')-1); 

So it does not use the internal date methods but directy date I thought it may have something to do with timezone settings.
So I made the cron run at one hour when my timezone and GMT timezone are in the same day.
Moved it to 2:10.
I didn't have any issues since then.

Related Topic