X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Using extra_fields as a "flag" (https://forum.x-cart.com/showthread.php?t=16588)

golfguy 09-14-2005 11:08 AM

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}


golfguy 09-17-2005 08:03 AM

Can't get no love?

groovico 09-17-2005 12:22 PM

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

golfguy 09-17-2005 01:41 PM

Thanks Groovico,

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

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

Code:

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


Thanks again :D


All times are GMT -8. The time now is 06:48 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.