View Single Post
  #26  
Old 03-19-2006, 10:26 PM
 
svowl svowl is offline
 

X-Cart team
  
Join Date: Jan 2003
Posts: 937
 

Default

Quote:
Originally Posted by groovico
Can we display and access Extra fields in the products.tpl and cart pages in 4.1.X like we could with all pre 4.X releases?

Yes. Below is an example of code to display all extra fields in products.tpl

Code:
{if $products[product].extra_fields ne ''} {foreach $products[product].extra_fields item=extra_field} {$extra_field.field}: {$extra_field.value} {/forach} {/if}

...and to display the extra field with service name 'ISBN':

Code:
{if $products[product].extra_fields ne ''} {foreach $products[product].extra_fields item=extra_field} {if $extra_field.service_name eq "ISBN"} {$extra_field.field}: {$extra_field.value} {/if} {/forach} {/if}

Note: Extra fields are identified by service names because identifying them by extra field IDs is not usable enough. Identifying extra fields by their interface names ('field' column) is impossible, as these names may be defined in more than one languages.
__________________
Vladimir Semyonov
Lead Software Engineer
Reply With Quote