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
Post a Comment