Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Fatal error: Call to a member function getPrice() on a non-object
 
beaugrover
Jr. Member
 
Total Posts:  4
Joined:  2008-09-29
 

Fatal error: Call to a member function getPrice() on a non-object in app/code/core/Mage/Catalog/Model/Product.php on line 111

Anybody a solutions for this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Could you provide a little more information? What class belongs to the object you are trying to contact the getPrice function on?

 
Magento Community Magento Community
Magento Community
Magento Community
 
beaugrover
Jr. Member
 
Total Posts:  4
Joined:  2008-09-29
 

product.php:

/**
* Get product price throught type instance
*
* @return unknown
*/
public function getPrice()
{
return $this->getPriceModel()->getPrice($this);
}

public function getTypeId()
{
return $this->_getData(’type_id’);
}

public function getStatus()
{
return $this->_getData(’status’);
}

 
Magento Community Magento Community
Magento Community
Magento Community
 
LindyKyaw
Sr. Member
 
Avatar
Total Posts:  138
Joined:  2008-01-02
Los Angeles
 

The price model is getting as:

public function getPriceModel()
{
return Mage::getSingleton(’catalog/product_type’)->priceFactory($this->getTypeId());
}

Can you try var_dump of $this->getPriceModel() and see what did you get.

 
Magento Community Magento Community
Magento Community
Magento Community
 
beaugrover
Jr. Member
 
Total Posts:  4
Joined:  2008-09-29
 

LindyKyaw,

How can/do I var_dump of $this->getPriceModel() ?

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