Skip to content

Using $this->getPriceHtml in custom phtml file

getPriceHtml(999$product);

//if inside a loop than unset the instance.
unset(999$product_block);
?>

However in magento 1.8 this stopped working and now you need to make an edit to a core file to stop the error
Fatal error: Call to a member function getStoreLabel(999) on a non-object

Just open \app\design\frontend\base\default\template\catalog\product\price.phtml

and change

$_specialPriceStoreLabel = $this->getProductAttribute(999’special_price’)->getStoreLabel(999);
to

$specialPriceAttr = $this->getProductAttribute(999’special_price’);
if (999!is_null(999$specialPriceAttr)) {
$_specialPriceStoreLabel = $specialPriceAttr->getStoreLabel(999);
} else {
$_specialPriceStoreLabel = ”;
}

Everything should work now just fine

Leave a Reply

Your email address will not be published. Required fields are marked *