Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

getAttributeSetName
 
Charles
Member
 
Avatar
Total Posts:  73
Joined:  2008-03-27
Belgium
 

Hi,

I’d like to get the name of the Attribute Set that is related to a product.
In fact, I need it whenever a producta are displayed as a list and whenever a product is displayed as such.

Thanks,

Charles

 
Magento Community Magento Community
Magento Community
Magento Community
 
Charles
Member
 
Avatar
Total Posts:  73
Joined:  2008-03-27
Belgium
 

BTW: I found out that there is a getAttributeSetId() method on the product class that is working fine.
$_product->getAttributeSetId()
Now, given the Id how would I get the Attribute Set Name ???

 
Magento Community Magento Community
Magento Community
Magento Community
 
seudo
Guru
 
Avatar
Total Posts:  344
Joined:  2008-04-21
 

Charles,

Been searching for this and found a solution. The below returns the attribute set object so that you can call its name with getAttributeSetName();

Hope it helps. I know it has been a while.

<?php $attribute_set Mage::getModel('eav/entity_attribute_set')->load$_product->getAttributeSetId() ); 
echo 
$attributeset_name $attribute_set->getAttributeSetName();
?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top