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

阅读 27

2023-04-28


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()

 

精彩评论(0)

0 0 举报