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)
-   -   Display an extra field on products.tpl (https://forum.x-cart.com/showthread.php?t=42972)

abeight 10-14-2008 03:20 PM

Display an extra field on products.tpl
 
Does anyone know if it's possible to display an extra field on the product listing page (products.tpl)? I'm using this code on the product detail page, but it doesn't work on the listing page.

{if $extra_fields.0.field_value ne ""}{$extra_fields.0.field_value}{/if}

V 4.1.11

TIA! :)

longhorn180 10-14-2008 04:21 PM

Re: Display an extra field on products.tpl
 
Here is the code to show an extra field on products.tpl in 4.1.xx. You just have to put the name of the extra field that you want to display in place of nameofextrafield.
Code:

{if $products[product].extra_fields ne ''}
{foreach from=$products[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "nameofextrafield"}
{if $extra_field.value ne ""}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}


abeight 10-14-2008 04:27 PM

Re: Display an extra field on products.tpl
 
Thank you so much! That worked perfectly. :)

longhorn180 10-14-2008 04:51 PM

Re: Display an extra field on products.tpl
 
No problem.

SamsonWebDesign 11-03-2008 11:38 PM

Re: Display an extra field on products.tpl
 
Quote:

Originally Posted by longhorn180
Here is the code to show an extra field on products.tpl in 4.1.xx. You just have to put the name of the extra field that you want to display in place of nameofextrafield.
Code:

{if $products[product].extra_fields ne ''}
{foreach from=$products[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "nameofextrafield"}
{if $extra_field.value ne ""}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}



Hi,

I am having difficulty getting an extra field to show on the product.tpl page not the products.tpl.

I have created an extra field called CONTENTS which will display the contents of a book if there are any in the field.
I've tried this code but it doesn't work.

Any ideas??

ChristineP 01-13-2009 01:19 PM

Re: Display an extra field on products.tpl
 
Thank you! I got this working on my product.tpl page as:

{if $product[product].extra_fields ne ''}
{foreach from=$product[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "service_name goes here"}
{if $extra_field.value eq "20"}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}

{if $product[product].extra_fields ne ''}
{foreach from=$product[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "service _name goes here"}
{if $extra_field.value eq "30"}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}


I've been trying to get this into 2 column (side by side) and I want to add a button to each extra field. Can someone point me in the right direction to achieve this?


Quote:

Originally Posted by longhorn180
Here is the code to show an extra field on products.tpl in 4.1.xx. You just have to put the name of the extra field that you want to display in place of nameofextrafield.
Code:

{if $products[product].extra_fields ne ''}
{foreach from=$products[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "nameofextrafield"}
{if $extra_field.value ne ""}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}



ChristineP 01-21-2009 07:06 AM

Re: Display an extra field on products.tpl
 
Longhorn180,

I have my extra fields showing on my products.tpl, though I want to add a custom button for a download to a specific extra field. How would I go about doing this?

Christine


Quote:

Originally Posted by longhorn180
Here is the code to show an extra field on products.tpl in 4.1.xx. You just have to put the name of the extra field that you want to display in place of nameofextrafield.
Code:

{if $products[product].extra_fields ne ''}
{foreach from=$products[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "nameofextrafield"}
{if $extra_field.value ne ""}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}



ARW VISIONS 01-21-2009 09:46 AM

Re: Display an extra field on products.tpl
 
try this..

{if $products[product].extra_fields ne ''}
{foreach from=$products[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "nameofextrafield"}
{if $extra_field.value ne ""}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}
{if $extra_field.service_name eq "nameofextrafield"}button code here{/if}

pfarcus 01-21-2009 11:02 AM

Re: Display an extra field on products.tpl
 
Is this to put an extra field the add product portion of the admin back end? If not, anyone know how that would be done?

Thx advance

ARW VISIONS 01-21-2009 11:20 AM

Re: Display an extra field on products.tpl
 
extra fierlds are already there

pfarcus 01-21-2009 11:25 AM

Re: Display an extra field on products.tpl
 
But only on the provider end of it and only if the provider adds them correct? I need permanent extra fields for all providers (and for admin would be nice) ie: file type, file version, file size etc.

ARW VISIONS 01-21-2009 11:27 AM

Re: Display an extra field on products.tpl
 
this is bit complicated, as the database, php files and .tpl files need to be updated.

pfarcus 01-21-2009 11:31 AM

Re: Display an extra field on products.tpl
 
Is it better to hire qualiteam or one of these mod people?

what do you think?

ARW VISIONS 01-21-2009 11:33 AM

Re: Display an extra field on products.tpl
 
probably. I could do it for you.

pfarcus 01-21-2009 11:39 AM

Re: Display an extra field on products.tpl
 
Ok, I meant which is more wise to hire, qualiteam or a modder. I'm thinking one of the fields has a drop down list of choices too. You can pm me with cost.

thx

ARW VISIONS 01-21-2009 11:48 AM

Re: Display an extra field on products.tpl
 
QT is good but sometimes they take a while and are a little hard to communicate with sometimes, IMHO. I used them alot in the beginning and the time difference and lack of good phone support caused me to astart learning all of this stuff so I could do it myself.

pauldodman 01-21-2009 11:52 AM

Re: Display an extra field on products.tpl
 
Quote:

QT is good but sometimes they take a while and are a little hard to communicate with sometimes
Agreed - and you could have to wait a while for them to get to it.
I'd let Ashley have a look - he'll have it figured out for you far quicker - plus with a modder - you get a more objective solution. With QT you have to tell them what you want - and they just do it in a robot like fashion, without applying business sense to the problem.

pfarcus 01-21-2009 12:00 PM

Re: Display an extra field on products.tpl
 
I'm interested, whats next? private message er....?

ARW VISIONS 01-21-2009 12:01 PM

Re: Display an extra field on products.tpl
 
sent PM

ChristineP 01-31-2009 10:09 AM

Re: Display an extra field on products.tpl
 
I tried this, but I'm still not having any luck. I created a new pdf_button.tpl so that the PDF button that I created will be clickable to the desired product pdf. My problem is I can get one extra field to show on the product side, but I have 3 seperate extra fields that I need to make into a clickable custom button for each product. I did look at a mod that someone suggested, but after emailing with the company it's determined that the mod is not what we will be using. Ashley do you have any suggestions for me to try?


Quote:

Originally Posted by Ashley
try this..

{if $products[product].extra_fields ne ''}
{foreach from=$products[product].extra_fields item=extra_field}
{if $extra_field.service_name eq "nameofextrafield"}
{if $extra_field.value ne ""}
{$extra_field.value}
{/if}
{/if}
{/foreach}
{/if}
{if $extra_field.service_name eq "nameofextrafield"}button code here{/if}



All times are GMT -8. The time now is 03:55 AM.

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