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

Arrrrggggh - Pulling my hair out!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-19-2006, 05:29 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default 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?
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #2  
Old 05-19-2006, 06:07 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

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}
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
Reply With Quote
  #3  
Old 05-19-2006, 07:33 AM
  TelaFirma's Avatar 
TelaFirma TelaFirma is offline
 

X-Adept
  
Join Date: Nov 2002
Location: North Carolina USA
Posts: 930
 

Default

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}
Reply With Quote
  #4  
Old 05-19-2006, 10:05 AM
 
Grant Grant is offline
 

Senior Member
  
Join Date: Apr 2006
Posts: 171
 

Default

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
__________________
X-Cart version : 4.0.18
Mod : Customer Also Bought
Mod : Custom catergory Templates
Mod : Custon Product Templates
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 07:47 AM.

   

 
X-Cart forums © 2001-2020