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

Displaying extra fields in products.tpl (solved)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-02-2003, 06:58 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default Displaying extra fields in products.tpl (solved)

Im trying to get the Details from product.tpl to display next to each product on the products.tpl page.

I tried adding the following but with little success:

Code:
{if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if}

So I modified it to something like this:

Code:
{if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl" productid=$products[product].productid product=$products[product].product} {/if}

But that didnt work as I expected. I understand I probably just need to pass the product id or information but am not skilled enough to figure it out on my own.

So in summary, where you see the list of products you see a short summary, a retail price and etcetera - I would also like to display the extra fields as shown on the product.tpl page.

Anyone know how ?

Thanks much !

Shimone
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #2  
Old 03-03-2003, 11:15 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

try:

{$products[product].fulldescr}
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 03-03-2003, 04:50 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Thanks for the reply.

I'm actually looking to get just the details, not the full description.

The details include in the file "modules/Extra_Fields/product.tpl"
otherwise known as Extra Fields. I may be calling it by the wrong name but that's what the language file says.


Thanks again for the help !


Shimone
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #4  
Old 03-04-2003, 03:41 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

I did notice the java code at the top of the product.tpl is relevant to the extra fields
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 03-04-2003, 05:37 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Exactly

I asked about the very same thing b4. It would be very helpful if we could do this.


Thanks
Reply With Quote
  #6  
Old 03-04-2003, 08:42 AM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Quote:
Originally Posted by shan
I did notice the java code at the top of the product.tpl is relevant to the extra fields

I believe the javascript on product.tpl is for the display of product options and for form validation.
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #7  
Old 03-04-2003, 03:43 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default Found the solution...

Okay, I figured out how to do this on my own.
It's actually pretty easy.

To display information from the extra fields simply add the following:

Code:
{$products[product].param00}

where param00 is the first extra field.

Continue from there and add as many extra fields as you have in the DB
Code:
{$products[product].param01} {$products[product].param02} {$products[product].param03} {$products[product].param04} {$products[product].param05}

This will simply list the fields.
You should also add what they are.
For example:

Code:
<table> <tr><td>Extra Field 01:</td><td>{$products[product].param01}</td></tr> <tr><td>Extra Field 02:</td><td>{$products[product].param02}</td></tr> <tr><td>Extra Field 03:</td><td>{$products[product].param03}</td></tr> </table>

I implemented this on the customers/products page directly beneath the line:

Code:
{$products[product].descr|truncate:300:"...":true}

If you're still unsure as to what the end result will look like try adding the code to the products page and you will soon see.

You may also want to consider adding it to the Featured Products page as well..

Also for reference, poking around the database and finding the xcart_products table will list all the available fields. Try switching out the param00 for something else (like fulldescr) and you will quickly see how easy this really is...

Thanks for the lead funkydunk
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #8  
Old 03-04-2003, 10:47 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

A lot of the tiny mods are really very easy once you understand how this thing hangs together.

Smarty just makes it really easy to just refer to a variable and hey presto it is on the page !
__________________
ex x-cart guru
Reply With Quote
  #9  
Old 04-11-2003, 11:47 AM
 
greggo greggo is offline
 

Member
  
Join Date: Oct 2002
Posts: 22
 

Default what about product options

I'm still mining around the forums, but is there any way to have the product options appear on the products.tpl page? I had this customized, but I lost it on upgrade and don't want to pay for it again.
__________________
Gregg Osofsky
Version 3.4.4 Gold
Reply With Quote
  #10  
Old 04-12-2003, 06:31 AM
 
leolodreamland leolodreamland is offline
 

Newbie
  
Join Date: Jan 2003
Posts: 1
 

Default

Quote:
I'm still mining around the forums, but is there any way to have the product options appear on the products.tpl page?
Yeah, I'm having difficulty doing that too. i tried pasting the code from the product.tpl page but the way it sits in the table screws it up in the products.tpl page, any advice anyone? it can't be that hard....
__________________
shuulup
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 10:49 PM.

   

 
X-Cart forums © 2001-2020