Question

How I can get all attributes group name of a specific eav resource model?

Was it helpful?

Solution

You can get the all attribute group by below code.

$entityType = 4; //catalog_product
$attributeSetTableWithPrefix = Mage::getSingleton("core/resource")->getTableName('eav_attribute_set');

$groups = Mage::getResourceModel('eav/entity_attribute_group_collection');
$groups->getSelect()->joinLeft(array('attribute_set' => $attributeSetTableWithPrefix), 'main_table.attribute_set_id = attribute_set.attribute_set_id', array())
->where('attribute_set.entity_type_id = ?', 4);

$attributeGroup = array();
foreach($groups as $group){
    $attributeGroup[]= $group->getAttributeGroupName();
}
var_dump($attributeGroup);
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top