Magento: 产品页面获取 attribute set name How do I get attribute set name?

Whenever you have a product object, you can access its attribute set like this:

$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName  = $attributeSetModel->getAttributeSetName();
$attributeSetId    = $attributeSetModel->getAttributeSetId()

OR

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

来源:http://stackoverflow.com/questions/2091375/how-do-i-get-attribute-set-name

Leave a Reply