Shopping cart price rules are causing significant slowdowns in Add to Cart and Checkout buttons.
I've found the issue addressed in two places with two different solutions:
I tried the above by creating a local copy of app/code/local/Mage/SalesRule/Model/Rule/Condition/Product.php and over wrote the validator function with:
public function validate(Varien_Object $object)
{
if(!Mage::registry("rule_condition_product_".$object->getProductId()))
{
$product = Mage::getModel('catalog/product')
->load($object->getProductId());
Mage::register("rule_condition_product_".$object->getProductId(),$product);
}
$product = Mage::registry("rule_condition_product_".$object->getProductId());
$product->setQuoteItemQty($object->getQty())
->setQuoteItemPrice($object->getPrice())
->setQuoteItemRowTotal($object->getRowTotal());
return parent::validate($product);
}
there was no improvement in performance
the other suggested solution is:
this suggests overriding the product->load() function but I'm not clear how/where they are suggesting to do this. I presume it is not a local version of app/code/core/Mage/Core/Model/Abstract.php
Any thoughts?