5

enter image description herewe have a problem with catalog price rules in 1.9.0

we have some 1000 products in a site.

we applied catalog price rules to give discount for 500 products.

i did't gave any date limit for catalog price rules

those special prices are displaying only until mid night.

next day, after mid- night special prices are not displaying in site.

cron is working fine.

please help me to find some solution.

4

4 Answers 4

1

You might need to do reindexing. Please reindex once then check it is working or not.

3
  • I reindexed everyhting using "Index management" in admin panel. every status is "ready" ,but still it disappeared today also. Commented May 15, 2015 at 5:00
  • 1
    can you give me access of admin panel because it's tough to know the problem without that?
    – Saurabh
    Commented May 15, 2015 at 5:14
  • hi @saurabh this is my cron settings : prntscr.com/75dnv9 if you tell what you need to see, i will post the screen shots, i am not in a position to give credentials.... Commented May 15, 2015 at 5:58
5

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

credits for genius "Alexei Yerofeyev". mostly i will never forget this man.

Yes, this is a bug in Magento (or some logic beyond my understanding). 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 here :

app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php

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

with this line:

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

After that you should be able to apply the rules.

2
  • This solution doesn't work for 1.9.2.2. I have still strange catalog rules disappering. Any fixes? I use GMT+2 timezone. Any other hints? I also tried this extension magentocommerce.com/magento-connect/fix-catalog-rules.html but it got even worse. Catalog Price resets were triggered each day. now its triggered when some things are changed in store - like extension is updated etc.
    – sellio
    Commented Jan 18, 2016 at 20:31
  • @sellio please post new question with what and all you tried and other details, hopefully you will get an answer..... Commented Jan 18, 2016 at 20:34
2

As stated above by @Baby-in-Magento the problem is with the indexer.

I had this problem as well, the issue exists when there is an offset of the local timezone greater than +01:00.

Basically just because magento is using the gmtTimestamp for the rule date which in the above stated case results in the day before today.

Therefor I developed a small module https://github.com/Chuvisco88/Chuvisco_CatalogRuleFix to fix the issue. If someone ever has this problem, please give it a try.

1
  • 1
    Chuvisco, than you for this. I installed your solution yesterday and today - voila! The rules still show up after 0100 AM. Thanks a lot! [Magento 1.9.3.2]
    – Sparc
    Commented Dec 22, 2017 at 2:03
1

In my setup the solution was to set the mysql timezone same as the magento timezone I managed it by using this initStatement in my local.xml file

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.