Product EAV Attribute Set, Group and Attribute List

Posted Almost 11 years ago. Visible to the public.

To see a list of all attribute sets, groups, and associated attributes for products, use this SQL. BONUS! Also shows the sort ordering, useful for determining which sort_order you need to place an attribute in a certain position:

SELECT s.attribute_set_name,
       g.attribute_group_name,
       a.attribute_code,
       a.frontend_label,
       ea.sort_order
FROM eav_attribute_set s
LEFT JOIN eav_attribute_group g   ON s.attribute_set_id   = g.attribute_set_id
LEFT JOIN eav_entity_attribute ea ON g.attribute_group_id = ea.attribute_group_id
LEFT JOIN eav_attribute a         ON ea.attribute_id      = a.attribute_id
WHERE s.entity_type_id = 4
ORDER BY s.attribute_set_name,
         g.sort_order,
         ea.sort_order;
Mike Whitby
Last edit
Almost 9 years ago
Mike Whitby
Posted by Mike Whitby to Magento (2013-06-13 10:38)