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)
-   -   Make extra field clickable (https://forum.x-cart.com/showthread.php?t=54351)

nivag 06-25-2010 02:49 PM

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....

cflsystems 06-25-2010 03:21 PM

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>

nivag 06-25-2010 04:06 PM

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 ?

cflsystems 06-25-2010 04:29 PM

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

nivag 06-25-2010 04:34 PM

Re: Make extra field clickable
 
Yes :-) that worked perfectly.... thank you for such quick solution....


All times are GMT -8. The time now is 02:04 AM.

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