To get it to work, you need to enclose it in the {foreach from=$row item=product}
{if $product} loop. Here's what I have in products_t.tpl to show any extra field that has a value:
Code:
<tr{interline name=products_matrix}>
{foreach from=$row item=product name=products}
{if $product}
<td{interline name=products additional_class="product-cell"} style="width: {$cell_width}%;">
{foreach from=$product.extra_fields item=v}
{if $v.active eq "Y" && $v.value ne ""}
<span class="">{$v.field}: {$v.value}</span><br />
{/if}
{/foreach}
</td>
{/if}
{/foreach}
</tr>
You don't need to make any changes in the php files. I did this in 4.3. There may be some unnecessary things in there; I just copied the loop from another loop (for product name) so there may be some bits that only belong there, but it does work.