我有一个属性组,我想属于某个特定属性组的属性列表。 有没有办法让所有属性的属性组下?
Answer 1:
工程于法师1.7.0.0:
function printGroupAttributes($groupId) {
$attributesCollection = Mage::getResourceModel('catalog/product_attribute_collection');
$attributesCollection->setAttributeGroupFilter($groupId);
foreach ($attributesCollection as $attribute) {
echo $attribute->getAttributeCode()."<br/>"; // I launch it from browser
}
}
$attributeGroupId = 534; // Fill with yours
printGroupAttributes($attributeGroupId);
来源: Mage_Catalog_Model_Product_Attribute_Group->hasConfigurableAttributes()
文章来源: how to get the all attributes that belongs to a attribute group in magento