getPrice() fatal error in magento customs product -


when try price attribute customs product, fatal error being thrown.

$_product->getprice();  fatal error: call member function getprice() on non-object in /opt/lampp/htdocs/sve279/app/code/core/mage/catalog/model/product.php on line 211 

when checked in core file, found this:

public function getpricemodel() {     return mage::getsingleton(‘catalog/product_type’)->pricefactory($this->gettypeid()); } 

so problem out customs product. know solution problem?

you got error when $_product object not loaded.

example: load product "sku"

$product = mage::getmodel('catalog/product')->loadbyattribute('sku',$row['sku']); echo $product->getprice();


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -