How can get Final Price, with applied price rule in Magento

Alex picture Alex · Mar 13, 2012 · Viewed 10.6k times · Source

For example

$_producte = Mage::getModel('catalog/product')->load(2974);
echo $_producte->getFinalPrice();

I can get in frontend when insert to .phtml

BUT I can not get final price (with discount) in admin section or in custom product export file.

Answer

benmarks picture benmarks · Mar 13, 2012

Price calculation in Magento is a hot mess. You need to load the frontend event area in order to trigger rule calculation (ref Mage_CatalogRule_Model_Observer::processFrontFinalPrice() configured in Mage_CatalogRule config.xml).

Mage::app()->loadAreaPart(Mage_Core_Model_App_Area::AREA_FRONTEND,Mage_Core_Model_App_Area::PART_EVENTS);