Catalog Price Rule Optimization

Oct 9, 2013443Alex Simonchik
Catalog Price Rule Optimization

I think many of you have heard about such a remarkable Mаgentо feature as Catalog Price Rule.

During one of our recent projects we faced a serious issue: our client had 1 website, 17 store views, over 50000 products and 200 Catalog Price rules. And he complained that the rules were no longer applying.

1Catalog Price Rule Optimization

During the investigation we found out that each time you create a new rule or edit an existing one and complete the process by clicking “Save and apply” Mаgentо rewrites all existing rules. I.e he method applyRules() is called during the function of saveAction() of the controller Mage_Adminhtml_Promo_CatalogController.

2Catalog Price Rule Optimization

Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Igor

So I created a module which, instead of rewriting all rules, recalculates only that one which has been edited. So now only a single rule is transmitted to the function updateRuleProductData(), which helped to solve the performance problem.

Due to this module changes to the database are made only for a certain rules and there is no chain reaction (re-saving the rest of the rules).


Smarty Apply Catalog Rule

Download Smarty Apply Catalog Rule from GitHub

Partner With Us Looking for a partner that will help you to grow your business? We are the right company to develop your webstore. Feel free to get in touch with us. We will be happy to discuss your business opportunities and provide you with a Free Quote. Talk to Igor


  1. – (re-saving the rest of the rules)

    here what is the issue while re-saving the rest of the rules? and how this becomes a for the customer’s complaint : ” And he complained that the rules were no longer applying.”

  2. Manaf,

    By default Magento is saving all rules while the module is changing only that one which has been changed.

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *