Wednesday, October 17, 2012

How to get attribute set name in Magento


>> $prodAttributeSet = Mage::getModel('eav/entity_attribute_set')->load($_product->getAttributeSetId())->getAttributeSetName();


>> To get the attributeset name in cart page see the following..
app/design/frontend/base/default/template/checkout/cart/item/default.phtml (or in your theme folder.)

Here you can see the cart item object $_item = $this->getItem(); at line 28. Then you have to load the product with product id.
<?php
    $_product = Mage::getModel('catalog/product')->load($_item->getProductId());
    $prodAttributeSet = Mage::getModel('eav/entity_attribute_set')->load($_product->getAttributeSetId())->getAttributeSetName();
?>