X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   How to change Recommendslist? (https://forum.x-cart.com/showthread.php?t=3740)

MOC 07-25-2003 07:39 PM

How to change Recommendslist?
 
Hi,

i wanna change the recommends to something like products.tpl. Just without buy buttons.

I want that the recommends will display a thumbnail, the name of the product and the price.

What i have to change? Can somebody help me?

Thanks
Saskia :D :?:

slimmedia 08-04-2003 01:07 PM

We do something like this. The recommends list is on the right and has thumbnails.

Check it out:
http://www.demolaystore.com/customer/product.php?productid=36&cat=21&page=1

Here's how it works (may vary depending upon your version of x-cart):

Code:

<CENTER>
{section name=num loop=$recommends}
<A HREF="product.php?productid={$recommends[num].productid}&cat={$cat}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$products[product].tmbn_url}

<font class="ProductTitle">{$recommends[num].product}</FONT>


{/section}
</CENTER>


You can make the change in 'skin1/modules/recommends.tpl' but I created a new template in the same directory called 'menu_recommends.tpl'.

Then I added the following code to the right hand VertMenuBox area.
Code:

{if $main eq "product"}
{include file="modules/Recommended_Products/menu_recommends.tpl" }
{/if}


And I commented out the call to recommends.tpl in 'skin1/customer/main/product.tpl'.

jeeya 08-04-2003 10:01 PM

.
 
It's just I wanted but I want it horizontally, I don't want it vertical becasue I am not going to put that in side menu.

What would be the code for, modules/Recommended_Products/recommends.tpl

so it can show horizontally instead of vertical

Thanks

jeeya 08-04-2003 10:50 PM

.
 
forgot, I mean I want them all in one row and also want to include dialog box.

Thanks

slimmedia 08-05-2003 07:28 AM

Again, it may need a little bit of tweaking depending upon your version of x-cart, but something like this should work:

In 'modules/Recommended_Products/recommends.tpl' replace the lines from {section} to {/section} with:
Code:

<TABLE BORDER="0" WIDTH="100%"><TR>
{section name=num loop=$recommends}
<TD VALIGN="TOP" WIDTH=33%>
<A HREF="product.php?productid={$recommends[num].productid}&cat={$cat}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$products[product].tmbn_url}

<font class="ProductTitle">{$recommends[num].product}</FONT></TD>
{/section}
</TR></TABLE>


For version 3.4.3, the whole file would look like this:

Code:

{if $recommends}
{capture name=recommends}
<TABLE BORDER="0" WIDTH="100%"><TR>
{section name=num loop=$recommends}
<TD VALIGN="TOP" WIDTH=33%>
<A HREF="product.php?productid={$recommends[num].productid}&cat={$cat}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$products[product].tmbn_url}

<font class="ProductTitle">{$recommends[num].product}</FONT></TD>
{/section}
</TR></TABLE>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"}
{/if}


jeeya 08-05-2003 02:14 PM

.
 
Thanks it worked great.

adpboss 08-05-2003 02:17 PM

Slick code and nice result!

I may just add something like this to my new store. Seems like menu space is always at a premium though. :)

jeeya 08-05-2003 02:19 PM

.
 
I have image size set up 85 for other product dislpay, is there a way to make image smaller just for recommended products,

here is my code-

{* $Id: recommends.tpl,v 1.3 2003/03/05 08:19:11 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
{section name=num loop=$recommends}
<TABLE BORDER="0" WIDTH="100%"><TR>
{section name=num loop=$recommends}
<TD ALIGN="TOP" WIDTH=5%>
<p align="center">
<A HREF="product.php?productid={$recommends[num].productid}&cat={$cat}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product tmbn_url=$products[product].tmbn_url}

<font class="ProductTitle">{$recommends[num].product}</FONT></TD>
{/section}
</TR></TABLE>
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"}
{/if}


this codes is working good in version 3.4.0

slimmedia 08-06-2003 06:20 AM

Sure, replace:

Code:

image_x=$config.Appearance.thumbnail_width

with:

Code:

image_x=50

Instead of 50, you could use any width you'd like.

jeeya 08-06-2003 07:57 PM

.
 
Worked fine.

thanks :D


All times are GMT -8. The time now is 11:59 PM.

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