View Single Post
  #22  
Old 02-24-2009, 07:06 AM
 
toltion toltion is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 39
 

Default Re: Extra Fields 4.1.x products_t.tpl

The code allows you to selectively display any extra field. I sometimes like to display the extra fields in different locations on the template, so I run the code at the top of the page and assign variables to the values. In this code I chose to identify the extra_fields by their Service Name instead of index position in the loop -
Code:
{section name=field loop=$extra_fields} {if $extra_fields[field].service_name eq "NO_SHIP_AIR"} {if $extra_fields[field].field_value ne ""}{assign var="no_ship_air" value="Y"}{/if} {/if} {if $extra_fields[field].service_name eq "CLEARANCE_PRICE"} {if $extra_fields[field].field_value ne ""}{assign var="clearance_price" value="Y"}{/if} {/if} {/section}

Then I can display the variables "no_ship_air" & "clearance_price" anywhere on the page using {if $no_ship_air ne ""}{$no_ship_air}{/if}.
__________________
X-Cart Gold 4.1.9
Gift Registry/Special Offers
Advanced mini-cart
XC-SEO
Mulltiple Category/Product Templates
Also bought/recently viewed
Feedback reviewer/viewer bundle
Marketing Manager Pro bundle
many more mods
Reply With Quote