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)
-   -   Displaying extra fields in products.tpl (solved) (https://forum.x-cart.com/showthread.php?t=1695)

BoomBoomBap 03-02-2003 06:58 PM

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

funkydunk 03-03-2003 11:15 AM

try:

{$products[product].fulldescr}

BoomBoomBap 03-03-2003 04:50 PM

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

shan 03-04-2003 03:41 AM

I did notice the java code at the top of the product.tpl is relevant to the extra fields

John7 03-04-2003 05:37 AM

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


Thanks

BoomBoomBap 03-04-2003 08:42 AM

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.

BoomBoomBap 03-04-2003 03:43 PM

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 ;-)

funkydunk 03-04-2003 10:47 PM

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 ! :D

greggo 04-11-2003 11:47 AM

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.

leolodreamland 04-12-2003 06:31 AM

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


All times are GMT -8. The time now is 10:02 PM.

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