I need to find a way to show the value of a custom attribute in place of the "Product Name" shown in the image below.
(source: magentocommerce.com)
I'm working with /app/design/frontend/default/defaultx/template/catalog/product/view/type/grouped.php
The code below doesn't work(the custom attribute is yearmade):
<?php if (count($_associatedProducts)): ?>
<?php foreach ($_associatedProducts as $_item): ?>
<tr>
<td><?php echo $this->htmlEscape($_item->getYearmade()) ?></td>
Any help would be appreciated.
EDIT: So the answer turned out to be quite simple. You see what I failed to mention above was that there was indeed output... but that it was just a number (eg: 52). Turns out this was the ID for that custom attribute value (It was a Dropdown type of custom attribute).
So in summary
This works for custom attributes of type text:
echo $this->htmlEscape($_item->getYearmade())
But for all other types of custom attribute (I think), the following should be used:
echo $this->htmlEscape($_item->getAttributeText('yearmade'))
I would not have discovered this without the most excellent answer provided by Alan Storm, below. Thank you sir.