Call to a member function getStoreLabel() in price.phtml

Home / Magento / Call to a member function getStoreLabel() in price.phtml

After upgrade Magento 1.8.0.0 get error on list and view page.
Fatal error: Call to a member function getStoreLabel() on a non-object in price.phtml

I got simple fix as below and its working fine for me.

Open this file : app/design/frontend/[your_package]/[your_theme]/template/catalog/product/price.phtml

Find this code:

$_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();

 

And replace it with below:

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

 

 

Related Posts

2 Comments

Leave a Reply

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