Thursday, 22 August 2013

Get products Values and Names from Group Magento

Get products Values and Names from Group Magento

I have this code that I found on another post that it is supposed to get
the group's attributes.
<?php function printGroupAttributes($groupId) {
$attributesCollection =
Mage::getResourceModel('catalog/product_attribute_collection');
$attributesCollection->setAttributeGroupFilter($groupId);
foreach ($attributesCollection as $attribute) {
echo $attribute->getAttributeCode()."<br/>"; // I launch it from
browser
}
}
$attributeGroupId = 224; // Fill with yours
printGroupAttributes($attributeGroupId);
?>
Unfortunatelly this gives me only the group's ids. What should I enter on
this code so I can get Names and Values also?
Thank you

No comments:

Post a Comment