Magento Forum

Fatal error: Call to a member function getStoreLabel() on a non-object in price.phtml
 
dumindard
Jr. Member
 
Total Posts:  5
Joined:  2008-05-29
 

Hi
After upgrading to 1.8 version i am having this error in my product detial page.

Fatal error: Call to a member function getStoreLabel() on a non-object in /hsphere/local/home/aaaa/aaa.com.au/app/design/frontend/base/default/template/catalog/product/price.phtml on line 50

Fix need asap.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

This sounds like an incompatibility with your theme, but I see from the error that you are using the default base template. Is that correct? Yhe same error is reported by a user of the “Blanco Fluid Theme” here: http://themeforest.net/item/blanco-fluid-responsive-magento-theme/discussion/2370280?page=29

Don’t know if it is related.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dumindard
Jr. Member
 
Total Posts:  5
Joined:  2008-05-29
 

Hi,

Thanks for the reply

I am using joomlart magento theme and not using default one.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
dumindard
Jr. Member
 
Total Posts:  5
Joined:  2008-05-29
 

And here is the related issue

http://themeforest.net/item/ultimo-fluid-responsive-magento-theme/discussion/3231798

see kunalmehta issue

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 
dumindard - 29 September 2013 04:04 AM

And here is the related issue

http://themeforest.net/item/ultimo-fluid-responsive-magento-theme/discussion/3231798

see kunalmehta issue

Looks like the theme is not compatible with Magento 1.8 then. Given that Magento 1.8 is just released, you may want to hold back the upgrade until there is an update available for your theme. Or you can try to fix the problem in the price.phtml file yourself.

 
Magento Community Magento Community
Magento Community
Magento Community
 
malachy
Jr. Member
 
Total Posts:  2
Joined:  2012-01-25
 

It is very simple to edit the price.phtml file yourself. That is what I did.

Create this file in your theme path to override the base file: so you create a new file

/app/design/frontend/yourTheme/default/template/catalog/product/price.phtml

and copy all the code from
/app/design/frontend/base/default/template/catalog/product/price.phtml
into it.

Then change line 50 in your new price.phtml file from

$_specialPriceStoreLabel $this->getProductAttribute('special_price')->getStoreLabel();
to
if ($myTheme_dummy $this->getProductAttribute('special_price')){
      $_specialPriceStoreLabel 
$myTheme_dummy->getStoreLabel();
    
}

Then upload this file to your server.

The new code just tests if

$this->getProductAttribute('special_price')
actually returns an object or not.
 
Magento Community Magento Community
Magento Community
Magento Community
 
LadySS
Jr. Member
 
Total Posts:  2
Joined:  2013-08-21
 

I had the same problem and I used this solution and it works! Hope can help somebody!
https://bitbucket.org/jamesckemp/magento-getstorelabel-error-v1.8/overview

I found this information here: http://wordpress.org/support/topic/php-fatal-error-when-using-shortcodes
grin

 
Magento Community Magento Community
Magento Community
Magento Community
 
novalis
Sr. Member
 
Avatar
Total Posts:  266
Joined:  2007-10-13
Berlin, Germany
 

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

and change

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

to

$specialPriceAttr $this->getProductAttribute('special_price');
    if (!
is_null($specialPriceAttr)) {
        $_specialPriceStoreLabel 
$specialPriceAttr->getStoreLabel();
    
else {
        $_specialPriceStoreLabel 
'';
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Fernando Miguel
Jr. Member
 
Total Posts:  5
Joined:  2009-09-24
 

Thank you! Works like a charm!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top