0
我想從屬性集中獲取屬性名稱的列表。我知道如何獲取屬性ID,但我無法弄清楚如何獲取名稱列表。這是我的代碼到目前爲止。如何從屬性集中獲取屬性名稱列表
<?php
$entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();
$attributeSetName = 'Brands';
$attributeSetId = Mage::getModel('eav/entity_attribute_set')
->getCollection()
->setEntityTypeFilter($entityTypeId)
->addFieldToFilter('attribute_set_name', $attributeSetName)
->getFirstItem()
->getAttributeSetId();
$attributes = Mage::getModel('catalog/product_attribute_api')->items($attributeSetId);
foreach($attributes as $_attribute){
var_dump($_attribute);
}
?>
由於這是偉大的! – bla0009