Alex Rivera | Logout

magento getting product type from product sku

Asked 2011-03-03T07:32:56.657
12

How can i get the product type(simplee,configurable/grouped ...) using product sku or id, i have loaded product collection and from that trying to prict type by

$_product->getTypeId()

But its not printing the product type. Please help me

Thanks

Edit
Report

1 Answer

8

I got product type following way in phtml file

$product=Mage::getModel('catalog/product')->load($product_id);
$productType=$product->getTypeID();
//Simple Product    
if($productType == 'simple')
{   
  echo "Simple Product";
}                           
//Configurable Product
if($productType == 'configurable')
{   
  echo "Configurable Product";
}
answered 2012-09-14T06:37:36.197

Your Answer