tags:

views:

65

answers:

1

Hi,

I need to get the attribute group of a certain attribute set , how can i do this ?

i think i got the attribute group id but i can't seem to get the attributes of that group.

    $attributes = $_product->getAttributes();

    foreach($attributes as $attribute)
    {
    $group_id =  $attribute->getData('attribute_set_info/' . $_product->getAttributeSetId() . '/group_id'); 
    print_r($group_id);          

    }  

I would really appreciate if somebody could help me out , thanx ;)

+1  A: 

Just use the ID to instantiate the model you want.

$product = Mage::getModel('catalog/product')->getCollection()->getFirstItem();
foreach($product->getAttributes() as $att)
{
    $group_id   = $att->getData('attribute_group_id');
    //Mage_Eav_Model_Entity_Attribute_Group
    $group      = Mage::getModel('eav/entity_attribute_group')->load($group_id);                
    var_dump($group);
}
Alan Storm