0

I want to generate a query, which returns me all of the attributes from a specific group. In the image below you can see the wanted result:D enter image description here

This is my try:

select ea.attribute_code from eav_attribute ea
inner join eav_entity_attribute eav
on ea.entity_type_id = eav.entity_type_id
inner join eav_entity_type t
on ea.entity_type_id = t.entity_type_id
where eav.attribute_group_id = 26 
and t.entity_type_code = 'catalog_product'

26 is the General id.

What should i change with my query ?

1 Answer 1

1

Take a look @ How to get the all attributes that belongs to a attribute group in magento

$groupId = 26;
$attributesCollection = Mage::getResourceModel('catalog/product_attribute_collection');
$attributesCollection->setAttributeGroupFilter($groupId);

Then to get the sql

echo $attributesCollection->getSelect()

or

echo $attributesCollection->getSelect()->__toString()
1
  • thx man, how do you know about this piece of code ? :) Commented Jul 28, 2014 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.