Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Using extra_fields as a "flag"

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-14-2005, 11:08 AM
 
golfguy golfguy is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Omaha,NE
Posts: 108
 

Default Using extra_fields as a "flag"

I'm trying to extra fields as a "y/n" flag to determine whether a special image is displayed on the product.tpl page.

I know I'm formatting the field wrong but I'm not sure how it should be formatted. can someone help?

Code:
{if $product.extra_fields[1].field_value eq "y"} [img]{$ImagesDir}/trophy.jpg[/img] {/if}
__________________
Version 4.2.3
Reply With Quote
  #2  
Old 09-17-2005, 08:03 AM
 
golfguy golfguy is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Omaha,NE
Posts: 108
 

Default

Can't get no love?
__________________
Version 4.2.3
Reply With Quote
  #3  
Old 09-17-2005, 12:22 PM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

Make sure that variable actually contains what you think it does do a

{$product.extra_fields[1].field_value} on the page so it prints it so you can see if it's the right field for starters
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #4  
Old 09-17-2005, 01:41 PM
 
golfguy golfguy is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Omaha,NE
Posts: 108
 

Default

Thanks Groovico,

That's just what I needed (a good wack on the head) when accessing by row everything starts at zero, "0"

I also got rid of the $product, so the winning answer is:

Code:
{if $extra_fields[0].field_value eq "y"}


Thanks again
__________________
Version 4.2.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:42 AM.

   

 
X-Cart forums © 2001-2020