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)
-   -   Arrrrggggh - Pulling my hair out! (https://forum.x-cart.com/showthread.php?t=21908)

Grant 05-19-2006 05:29 AM

Arrrrggggh - Pulling my hair out!
 
I'm trying to pull a customised version of modules/Extra_Fields/product.tpl.

Here is the code...

Quote:

{* $Id: product.tpl,v 1.7 2004/05/28 12:21:07 max Exp $ *}
{section name=field loop=$extra_fields}
{if $extra_fields[field].active eq "Y" && $extra_fields[field].field_value}
{$extra_fields[field].field_value}
{/if}
{/section}

I am managing to call it in a customised version of skin1/customer/main/product.tpl without any hassle.
The problem I do have is that when it calls it displays ALL extra fields and I only want it to display 1.

Field name : RunningTime
Field no. : 4

I have tried all sorts of configurations but I can't get it to work. Anybody know what I should be doing?

Grant 05-19-2006 06:07 AM

I first tried calling this Field internally on the customer/main/product.tpl the same way I do on the product_t.tpl but for some reason when I add this to customer/main/product.tpl it generates syntax errors.

So that's why I'm using a modded modules/extra_fileds/product.tpl instead (in case you were wondering) ;)

This is the code I usually use which works a treat.

Quote:

{assign
var="RunningTime" value=$products[product].productid|extrafield:4}
{if $RunningTime ne ""} {$RunningTime} {/if}

TelaFirma 05-19-2006 07:33 AM

If what you are trying to do is display the field/value of an extra field named "RunningTime" then do this:

Code:

{section name=field loop=$extra_fields}
{if $extra_fields[field].active eq "Y" && $extra_fields[field].field eq "RunningTime"}
{$extra_fields[field].field}: {$extra_fields[field].field_value}
{/if}
{/section}


Grant 05-19-2006 10:05 AM

Quote:

Originally Posted by TelaFirma
If what you are trying to do is display the field/value of an extra field named "RunningTime" then do this:

Code:

{section name=field loop=$extra_fields}
{if $extra_fields[field].active eq "Y" && $extra_fields[field].field eq "RunningTime"}
{$extra_fields[field].field}: {$extra_fields[field].field_value}
{/if}
{/section}



Word to tha muthaland!

That worked a treat. Thanks Telafirma ;)


All times are GMT -8. The time now is 06:16 AM.

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