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

Make extra field clickable

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-25-2010, 02:49 PM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default Make extra field clickable

Hi, thanks in advance for any replies.....

I would like to make the contents of an extra field clickable as it will display a url - so much easier for the customer to simply click the url instead of cut & paste etc....
Would anyone know of a way to do this ?
BTW there are a lot of products so changing the field properties would be easier instead of manually adding html or similar to every single product.

Thank you....
Reply With Quote
  #2  
Old 06-25-2010, 03:21 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Make extra field clickable

You just have to put the field value in an <a> tag. Look in skin1/modules/Extra_Fields/product.tpl

You can replace
<td class="property-value">{$v.field_value}</td>
with
<td class="property-value">
{if $v.field eq "yyyy"}
<a href="{$v.field_value}">xxxx</a>
{else}
{$v.field_value}
{/if}
</td>
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
nivag (06-25-2010)
  #3  
Old 06-25-2010, 04:06 PM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default Re: Make extra field clickable

Hi thank you.... its not working... can I just double check it...

Heres my original tpl - it is slightly different but dont think that would make a difference?

Code:
{* $Id: product.tpl,v 1.14 2009/07/21 13:23:30 joy Exp $ vim: set ts=2 sw=2 sts=2 et: *} {foreach from=$extra_fields item=v} {if $v.active eq "Y" && $v.field_value} <tr> <td class="property-name">{$v.field}</td> <td class="property-value" colspan="2">{$v.field_value}</td> </tr> {/if} {/foreach}

And this is what I changed it to:

Code:
{* $Id: product.tpl,v 1.14 2009/07/21 13:23:30 joy Exp $ vim: set ts=2 sw=2 sts=2 et: *} {foreach from=$extra_fields item=v} {if $v.active eq "Y" && $v.field_value} <tr> <td class="property-name">{$v.field}</td> <td class="property-value"> {if $v.field eq "yyyy"} <a href="{$v.field_value}">xxxx</a> {else} {$v.field_value} {/if} </td> </tr> {/if} {/foreach}

Have I made an obvious mistake ?
Reply With Quote
  #4  
Old 06-25-2010, 04:29 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Make extra field clickable

Yes you did. You need to replace "yyyy" with the field name and "xxxx" with whatever you want the link to be called. Right now the code is looking for an extra field "yyyy" and of course won't find any
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
nivag (06-25-2010)
  #5  
Old 06-25-2010, 04:34 PM
 
nivag nivag is offline
 

Advanced Member
  
Join Date: Oct 2008
Posts: 76
 

Default Re: Make extra field clickable

Yes that worked perfectly.... thank you for such quick solution....
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 04:02 AM.

   

 
X-Cart forums © 2001-2020