0

We have a problem with catalog price rules in 1.9.0

We uploaded 1000 products in a site.

After catalog price rules to give discount for 500 products, there is no 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 job is working fine.

Please help me to find some solution.

mas4
  • 989
  • 1
  • 8
  • 20

3 Answers3

1

this issue was only solved for me with this:

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);

view the original post: https://magento.stackexchange.com/questions/67970/catalog-price-rules-disappear-after-mid-night

Community
  • 1
  • 1
0

Step 1:
Please make sure that Cron is working fine. For this you can install AOE Scheduler extension.

Step 2:
You need to debug the issue by debugging magento tables. Following tables used for catalog rules:

catalogrule
catalogrule_affected_product
catalogrule_customer_group
catalogrule_group_website
catalogrule_product
catalogrule_product_price
catalogrule_website

You can delete all catalog rules and create one single rule for one product and check following tables:

catalogrule_product - In this table Magento will manage all product discount percent for all customer group.
catalogrule_product_price - In this table Magento will manage discounted final price for each product. Here magento will insert three days record for each record. you can check this by "rule_date" field.

If it is work perfectly. Then Again After deleting all Catalog rules again, Please truncate following tables from MySQL.

catalogrule_product
catalogrule_product_price 

As due to many records primary key reach on maximum limit and try again by creating rule for 500 products. hope it will start work.

Hope this help!!

Pankaj Pareek
  • 3,806
  • 2
  • 31
  • 42
  • thanks a lot for reply, please check here : http://prntscr.com/75e1fb i used this extension : magentocommerce.com/magento-connect/aoe-scheduler.html i am getting message as in the image. i hope cron job is working fine. if so please inform me. and i will look at the step 2 now...... –  May 15 '15 at 07:08
  • Yes cron is working fine. If answer worked you then please accept and upvote the answer so that other will get benefit too. – Pankaj Pareek May 15 '15 at 07:28
  • ya, sure i will do that..... cron is working fine but catalog price rules are giving problem. as this is a live site, i am really not in a position to disable all catalog price rules and to to apply catalog price rule for only one product. –  May 15 '15 at 07:35
  • this is catalogrule_product_price table : http://prntscr.com/75e80b can you please check and tell is there anything wrong? –  May 15 '15 at 07:36
  • in above image it showing, it is applying for all 3 days, but why it disappearing after mid night, please help about this.... –  May 15 '15 at 07:39
  • From image it shows that primary key not reached to max limit. May be this will solve your issue : http://stackoverflow.com/questions/25280095/magento-catalog-price-rule-disappears-at-night?rq=1 – Pankaj Pareek May 15 '15 at 09:04
  • as i am new to magento, how you found out "primary key" is not reached to maximium limit.... –  May 15 '15 at 10:52
0

As stated above by @Davi-Reinoldo 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.

Chuvisco
  • 101
  • 1
  • 6