"Call to member function getStoreLabel()..."

Magento is just released version As a result, lots of customers want to upgrade their website to this latest version. Magento does not have much major updates and it seems to be only bug fixes. But we still have some problems after upgrading. One of them is this message:
Fatal error: Call to a member function getStoreLabel() on a non-object in price.phtml
It does not always display, not in product detail or category page but if your website has a block of products in home page, it might be a problem.
If you get this issue, here is a temporary fix for now.
1) Copy file app/design/frontend/base/default/template/catalog/product/price.phtml to app/design/frontend/[your_package]/[your_theme]/template/catalog/product/price.phtml
2) Find this line:

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

And change it to:

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

I am not sure if it is a good fix but you try it. If you have any better suggestion, please let me know.

4 thoughts on “"Call to member function getStoreLabel()..."”

4 Responses to "Call to member function getStoreLabel()..."

  • nikunj
    nikunj on July 6, 2015 at 11:13 pm said:

    Thank you for sharing this code.....It's working ....good....Thank you

  • Niraj

    In place of
    $_specialPriceStoreLabel = $this->getProductAttribute('special_price')->getStoreLabel();
    use this one

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

  • Craig Tommola
    Craig Tommola on January 30, 2016 at 7:33 am said:

    I am getting this error in and the fix is not addressing it. Ideas on how to modify it?

  • alex

    I am getting this error when I upgrade magento to and works with the last code of Niraj send to us, thanks Niraj..