title: Magento - Show Custom Attributes in Grouped Product table
body: <p>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.</p>
  
  <p><a href="https://i.stack.imgur.com/qCdw4.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qCdw4.gif" alt="Grouped products table"></a><br>
  <sub>(source: <a href="http://www.magentocommerce.com/images/uploads/grouped_prod_front.gif" rel="nofollow noreferrer">magentocommerce.com</a>)</sub>  </p>
  
  <p>I'm working with /app/design/frontend/default/defaultx/template/catalog/product/view/type/grouped.php </p>
  
  <p>The code below doesn't work(the custom attribute is yearmade):  </p>
  
  <pre><code>&lt;?php if (count($_associatedProducts)): ?&gt;  
  &lt;?php foreach ($_associatedProducts as $_item): ?&gt;  
      &lt;tr&gt;  
          &lt;td&gt;&lt;?php echo $this-&gt;htmlEscape($_item-&gt;getYearmade()) ?&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>EDIT: So the answer turned out to be quite simple. You see what I failed to mention above was that there <em>was</em> 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).</p>
  
  <p>So in summary<br>
  This works for custom attributes of type text:</p>
  
  <pre><code>echo $this-&gt;htmlEscape($_item-&gt;getYearmade())
  </code></pre>
  
  <p>But for all other types of custom attribute (I think), the following should be used:</p>
  
  <pre><code>echo $this-&gt;htmlEscape($_item-&gt;getAttributeText('yearmade'))
  </code></pre>
  
  <p>I would not have discovered this without the most excellent answer provided by Alan Storm, below. Thank you sir.</p>