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
本文介绍了如何在Magento中通过产品的对象来获取其属性集的名字。提供了两种不同的方法实现这一目标,包括直接加载产品属性集ID并获取名字,以及通过模型加载后的相关方法调用来完成。
410

被折叠的 条评论
为什么被折叠?



