It can be useful to count how many products belong to each attribute set. The simplest approach in Magento 2 is the following SQL query:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
SELECT eas.attribute_set_id, eas.attribute_set_name, COUNT(cpe.entity_id) AS product_count FROM eav_attribute_set eas LEFT JOIN catalog_product_entity cpe ON cpe.attribute_set_id = eas.attribute_set_id WHERE eas.entity_type_id = ( SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product' ) GROUP BY eas.attribute_set_id, eas.attribute_set_name ORDER BY eas.attribute_set_name; |
The result lists the number of products assigned to each attribute set.
Counting products per attribute set using SQL
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.