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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -