Cant retrieve discounted product price in custom script

前端 未结 1 611
执念已碎
执念已碎 2021-01-24 14:33

I have a custom script that outputs a list of particular products in csv format. The frontend of the store just runs fine, however when retrieving the price of a product in my s

1条回答
  •  遥遥无期
    2021-01-24 15:15

    Product final price is calculated in an observer, and your script is not loading the events configuration.

    See my addition below.

    loadAreaPart(Mage_Core_Model_App_Area::AREA_FRONTEND, Mage_Core_Model_App_Area::PART_EVENTS);
    
        $product = Mage::getModel("catalog/product")->load(27809);
    
        echo $product->getFinalPrice();
    ?>
    

    See Mage_CatalogRule_Model_Observer::processFrontFinalPrice();.

    0 讨论(0)
提交回复
热议问题