如何获取magento中属于属性组的所有属性

use*_*332 2 magento magento-1.6

我有一个属性组,我想获取属于特定属性组的属性列表.有没有办法获得属性组下的所有属性?

Kat*_*ico 5

适用于法师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);
Run Code Online (Sandbox Code Playgroud)

资源: Mage_Catalog_Model_Product_Attribute_Group->hasConfigurableAttributes()