View Single Post
  #7  
Old 01-09-2010, 09:02 AM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default Re: Can't get extra fields to show in other places

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.
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote