I have a module that directly changes a product's price in the database. I would like for the
catalog price rules, the various discounts on our site, to get applied to the product's price after I update the base price.
Saving the item, either in admin area or with a
->save() call sets the prices, but it takes far too long to save all the items we need. I want to just recalculate the discount prices without doing anything else.
I've tried various 're-indexing' methods, but I don't know if this is the issue. Nothing I've done seems to affect the product's price. Below is a overview of the attempts I've made that haven't born fruit:
This runs without error but doesn't seem to actually update the discounted prices on the front end.
Mage::getSingleton('index/indexer')->processEntityAction( $product, 'catalog_product', Mage_Index_Model_Event::TYPE_SAVE );
Again, this will run without error, but it won't change the price. I've tried changing
TYPE_REINDEX all without success.
Mage::getModel('catalog/product_indexer_price')->reindexAll(); $event = Mage::getSingleton('index/indexer')->logEvent( $product, $product->getResource()->getType(), Mage_Index_Model_Event::TYPE_SAVE, false ); Mage::getSingleton('index/indexer') ->getProcessByCode('catalog_product_price') ->setMode(Mage_Index_Model_Process::MODE_REAL_TIME) ->processEvent($event);
Once again, no errors, but also no price updates.
To be clear, the
base price will show up immediately. It is only the
actual price that is calculated with all of the
catalog price rules that isn't updating.
Caching is disabled on my development system.