pedropeixoto
pedropeixoto

Reputation: 1633

Displaying all attributes on the simple product table of a grouped product - Magento

I'd like to show all the attributes of a simple product in the grouped product view.

Is there any easy way to do this?

echo $this->htmlEscape($_item->getAttName() works, but then I would have to edit the file every time I had a new attribute, not to mention it would bloat the code if dozens of attributes exist.

Is there anything set up on magento to do this without much hassle?

Thank you!

Attached is an image that illustrates what I'm saying.!

Illustration

Upvotes: 1

Views: 1280

Answers (1)

Jonathan Day
Jonathan Day

Reputation: 18702

Try this in grouped.phtml inside the foreach loop:

foreach($oItem->getAttributes() as $attr):
   echo $attr->getAttributeCode().' '.$attr->getAttributeValue();
endforeach;

Obviously you'll need to change the structure of the values that you echo out, but it should work.

Cheers, JD

Upvotes: 3

Related Questions