Get all attributes group of a specific resource model?
-
13-12-2019 - |
Question
How I can get all attributes group name of a specific eav resource model?
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