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)
-   -   Pictures in recommends.tpl for 3 column format (https://forum.x-cart.com/showthread.php?t=7506)

TJ Stephens 10-24-2006 04:03 PM

Re: Pictures in recommends.tpl for 3 column format
 
Tuan,

Thanks for your post #37. Worked great on 4.1.3!

TJ Stephens 10-24-2006 09:12 PM

Re: Pictures in recommends.tpl for 3 column format
 
I am testing 4.1.3 right now. I am using the code on post #37 and was getting a smarty error when there were no bestsellers or related products (I have incorporated this mod into my related products). In order to fix the smarty error, I had to wrap some of the language in modules/Bestsellers/bestsellers.php in an if statement. I used the following code and it seemed to work.
Put this at the bottom of modules/Bestsellers/bestsellers.php
Code:

if ($bestsellers) {
        foreach ($bestsellers as $i=>$item) {
        $bestsellers[$i]["tmbn_url"] = func_get_image_url($item[productid],"T");
        }
}

$smarty->assign("bestsellers",$bestsellers);
?>

I also added a similar line to the bottom of my modules/Upselling_Products/related_products.php file so that a tmbn_url would get passed so I could have images on my related products.
Code:

if ($product_links) {
        foreach ($product_links as $i=>$item) {
        $product_links[$i]["tmbn_url"] = func_get_image_url($item[productid],"T");
        }
}

$smarty->assign("product_links",$product_links);
?>

Hope this helps.

SusanMoore 11-10-2006 11:43 AM

Re: Pictures in recommends.tpl for 3 column format
 
I took Balinor's "fix" and was nearly satisfied with the results. However, I moved the <a href> link higher in the code so that the user could click the figure as well as the text to go to the upsell product, and I inserted a <br> to force the text to the following line: Here's my modified code that seems to work fine in 4.0.19:

{* $Id: related_products.tpl,v 1.7.6.1 2004/12/06 svowl Exp $ *}
{if $product_links ne ""}

{capture name=dialog}
{assign var="tmp" value="0"}

{section name=cat_num loop=$product_links}
{if $product_links[cat_num].productid}{assign var="tmp" value="1"}{/if}
{/section}

{section name=cat_num loop=$product_links}

{ if %cat_num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}

{if $smarty.section.cat_num.index is div by 3}
</tr><tr valign="top">
{/if}

<td width="250" align="center">

<a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>

{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=$config.Appearance.thumbnail_width product=$product_links[cat_num].product tmbn_url=$product_links[cat_num].tmbn_url}

<BR>
<span class="ProductTitle">{ $product_links[cat_num].product|escape}</span>
</a></td>
{ if %cat_num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}

{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}
{/if}

Cheers,
Susan

summitmn 11-20-2006 10:10 AM

Re: Pictures in recommends.tpl for 3 column format
 
Quote:

Originally Posted by mlfnet
I was looking around the forums to display pictures in the recommends.tpl and came across some code, but it had prices and was setup for 1 column. I edited it so it would display in a 3 colums with just the picture and title.


Where did you find this original set of code? I have searched but cannot find it. I want to add prices and pictures but for only 1 column.

Cankus 01-24-2007 08:12 AM

Re: Pictures in recommends.tpl for 3 column format
 
skin1/modules/Recommended_Products/recommends.tpl

This is workign on 4.3.1



{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}

{assign var="tmp" value="0"}

{section name=num loop=$recommends}
{if $recommends[num].productid}{assign var="tmp" value="1"}{/if}
{/section}

{section name=num loop=$recommends}

{ if %num.first% }
<table border=1 cellspacing=5 width=100%>
{/if}

{if $smarty.section.num.index is div by 3}
</tr><tr valign="top">
{/if}

<td width="250" align="center">


{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=100 product=$recommends[num].product tmbn_url=$recommends[num].tmbn_url}
<a href="product.php?productid={ $recommends[num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>

<BR>

<span class="ProductTitle">{ $recommends[num].product|escape}</span><br>

</a></td>
{ if %num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{/if}

Acquamarina 02-04-2007 09:33 AM

Re: Pictures in recommends.tpl for 3 column format
 
Cankus,

Did you mean 4.1.3? Has anyone tested it in 4.1.6? Also, can this be used for the Related Products?

I don't use the recommended products because they are random. I only use the related products that are chosen to appear on the product page (upselling links) and I really need to add columns there.
If this code does not work, does any one know where I can find the right one?

Thanks!

Cankus 02-04-2007 11:41 PM

Re: Pictures in recommends.tpl for 3 column format
 
This code for related products and working on 4.3.1

File : skin1/modules/Upselling_Products/related_products.tpl


{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}

{assign var="tmp" value="0"}

{section name=num loop=$product_links}
{if $$product_links[num].productid}{assign var="tmp" value="1"}{/if}
{/section}

{section name=num loop=$product_links}

{ if %num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}

{if $smarty.section.num.index is div by 3}
</tr><tr valign="top">
{/if}

<td width="250" align="center">

{include file="product_thumbnail.tpl" productid=$product_links[num].productid image_x=100 product=$product_links[num].product tmbn_url=$product_links[num].tmbn_url}
<a href="product.php?productid={ $product_links[num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>

<BR>

<span class="ProductTitle">{ $product_links[num].product|escape}</span><br>

</a></td>
{ if %num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.recommends extra='width="100%"'}
{/if}

Pantalonas 02-19-2007 03:42 AM

Re: Pictures in recommends.tpl for 3 column format
 
Thank you for the code, works great!

Mark

Warwick 02-20-2007 01:10 PM

Re: Pictures in recommends.tpl for 3 column format
 
Sorry if this has been covered already but is it possible to just show related products from the same category of the page it is on?

mitash 04-21-2007 05:26 PM

Re: Pictures in recommends.tpl for 3 column format
 
This mod is great... I just installed it on 4.1.6 and looks great.

Thanks!!

shishapipe 04-27-2007 08:21 AM

Re: Pictures in recommends.tpl for 3 column format
 
hi i wish i could hel;p others like your goodselves

just to say a big thank you for pips helping out here

alru111 04-29-2007 11:30 AM

Re: Pictures in recommends.tpl for 3 column format
 
I think somebody asked already about displaying price in recommended products. I tried to simply add SQL statement to pull price but it keeps giving me an sql error. Don't know what I am doing wrong. Did anyone figured it out?

simonc101 05-10-2007 03:07 AM

Re: Pictures in recommends.tpl for 3 column format
 
I have installed this mod on 4.1.7 and seems to sometimes work but most of the time the dialog box empty can anyone help me get this one working correctly? here is the code I put in related_product.tpl is there any other I need to add else?


{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}

{assign var="tmp" value="0"}

{section name=num loop=$product_links}
{if $$product_links[num].productid}{assign var="tmp" value="1"}{/if}
{/section}

{section name=num loop=$product_links}

{ if %num.first% }
<table border=0 cellspacing=5 width=100%>
{/if}

{if $smarty.section.num.index is div by 3}
</tr><tr valign="top">
{/if}

<td width="250" align="center">

{include file="product_thumbnail.tpl" productid=$product_links[num].productid image_x=100 product=$product_links[num].product tmbn_url=$product_links[num].tmbn_url}
<a href="product.php?productid={ $product_links[num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>

<BR>

<span class="ProductTitle">{ $product_links[num].product|escape}</span><br>

</a></td>
{ if %num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No related products.
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.recommends extra='width="100%"'}
{/if}

HWT 05-28-2007 06:17 AM

Re: Pictures in recommends.tpl for 3 column format
 
Here's a copy/paste that is working in 4.1.7

Code:

{* $Id: related_products.tpl,v 1.15 2005/12/07 14:07:32 max Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
{section name=cat_num loop=$product_links}
{ if %cat_num.first% }<table>{/if}
  {if $smarty.section.cat_num.index is div by 3}    </tr><tr valign="top">{/if}
 
<td align=center>
 <a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Upselling_Products.upselling_new_window eq 'Y'} target="_blank"{/if} class="ItemsList">{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=75 product=$product_links.product}<br />
 {$product_links[cat_num].product}</a></li>
</td>
{ if %cat_num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra='width="100%"'}
{/if}


JWait 07-18-2007 02:27 PM

Re: Pictures in recommends.tpl for 3 column format
 
Quote:

Originally Posted by Warwick
Sorry if this has been covered already but is it possible to just show related products from the same category of the page it is on?


That would be great, but I haven't seen it done.

JWait 07-18-2007 02:31 PM

Re: Pictures in recommends.tpl for 3 column format
 
Quote:

Originally Posted by simonc101
I have installed this mod on 4.1.7 and seems to sometimes work but most of the time the dialog box empty can anyone help me get this one working correctly? here is the code I put in related_product.tpl is there any other I need to add else?


Um... this mod is for Recommended Products. It looks like you are confusing it with Related products (also known as Upselling Products. They are two different Modules.

Pilnik 08-05-2007 08:16 PM

Re: Pictures in recommends.tpl for 3 column format
 
Did somebody succeed to display prices of recommended products under their thumbnail?
In terms of usability is absolutely necessary, as nobody will be clicking images to check prices.

DreamCatcher 08-12-2007 10:33 AM

Re: Pictures in recommends.tpl for 3 column format
 
Quote:

Originally Posted by HWT
Here's a copy/paste that is working in 4.1.7

Code:

{* $Id: related_products.tpl,v 1.15 2005/12/07 14:07:32 max Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
{section name=cat_num loop=$product_links}
{ if %cat_num.first% }<table>{/if}
  {if $smarty.section.cat_num.index is div by 3}    </tr><tr valign="top">{/if}
 
<td align=center>
 <a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Upselling_Products.upselling_new_window eq 'Y'} target="_blank"{/if} class="ItemsList">{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=75 product=$product_links.product}<br />
 {$product_links[cat_num].product}</a></li>
</td>
{ if %cat_num.last% }
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra='width="100%"'}
{/if}



Awesome! Thank you and it is working in 4.1.8 as well but I noticed it is missing the correct alt tags for the images.

moniquelynn 08-17-2007 06:01 PM

Re: Pictures in recommends.tpl for 3 column format
 
Thanks from a newbie. I've leaned two fanastic things from this thread:

1. I now have pics in my recommends! :D

2. Read threads from back to front to get the latest mod code. hehehe

adriant 10-22-2007 09:38 AM

Re: Pictures in recommends.tpl for 3 column format
 
This was getting all a bit complicated for me. I just wanted 3 in a row with thums and prices.

Being a newbie I gleaned a lot from this previous messages and decided, bravely to have a go myself.

Here's what I did to recommends.tpl

{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
<table border=0 width=100%>
<tr>

{section name=num loop=3}
<td width=33% align=center valign=top>
<a href="product.php?productid={$recommends[num].productid}" class="ItemsList">{$recommends[num].product}</a></font>
<br>
<a href="product.php?productid={$recommends[num].productid}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
<br>
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].taxed_price}</font><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>
</td>
{/section}

</tr>
</table>

{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{/if}

It works for me.

All the best
Ade

Acquamarina 01-04-2008 07:03 AM

Re: Pictures in recommends.tpl for 3 column format
 
Hi,

It doesn't work for me on 4.1.9 It does not display anything.

Does anyone have the tpl for 4.1.9?

Thanks in advance!

PS: HWT- the template you have here is not for the Recommended Products that are randomly generated by x-cart. It is for Related Products which one chooses in Admin - that's a different mod all together.

MoonDog 01-04-2008 05:44 PM

Re: Pictures in recommends.tpl for 3 column format
 
Acquamarina,
Try this. It's for the Recommended products list for v4.1.8 and v4.1.9

Replace your skin1/modules/Recommended_Products/recommends.tpl file with the file below:

Code:

{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
{assign var="tmp" value="0"}
{section name=num loop=$recommends}
{if $recommends[num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=num loop=$recommends}
{if %num.first%}
<table border=0 width="100%">
<tr>
{/if}
{if $smarty.section.num.index is div by 3}
</tr><tr valign="top">
{/if}
<td width=33% align=center valign=top class="PListCell";>
<a href="product.php?productid={$recommends[num].productid}" class="ItemsList">{$recommends[num].product}</a>
<br />
<a href="product.php?productid={$recommends[num].productid}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width product=$recommends[num].product type="T"}</a>
<br />
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].taxed_price}</font>
</td>
{if %num.last%}
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No recommends with this product.
{/capture}
{/if}


- MoonDog -

Acquamarina 01-04-2008 06:27 PM

Re: Pictures in recommends.tpl for 3 column format
 
MoonDog,

It works like a charm! Thank you so much! It looks great.

ScrapProfessor 03-18-2008 03:43 PM

Re: Pictures in recommends.tpl for 3 column format
 
YAY! Thank you MoonDog! I am running x-cart PRO v 4.1.9 and your code worked perfectly for me as well.

THANK YOU!!!

cooldude 03-21-2008 10:21 AM

Re: Pictures in recommends.tpl for 3 column format
 
It works great Moondog. You are my hero!

yuichi 04-05-2008 11:32 AM

Re: Pictures in recommends.tpl for 3 column format
 
Great work Moondog!!

m28m 04-06-2008 07:56 AM

Re: Pictures in recommends.tpl for 3 column format
 
Hi Moondog,your code load the photo from DB,can you supply the code that load the photo from file system?Thank you very much!

MoonDog 04-06-2008 09:44 PM

Re: Pictures in recommends.tpl for 3 column format
 
Hi m28m,

Code:


...your code load the photo from DB, can you supply the code that load the photo from file system?...


I think you might be mistaken. The code I placed above works with the images in the file system and not from the database. Try installing it and it should work.

- MoonDog -

EN4U 04-28-2008 11:31 AM

Re: Pictures in recommends.tpl for 3 column format
 
Moondog,

I added your code and it sets up the table good and all, but images arent showing up.. its just showing a box and within it "image not available"

i use telafirmas image mod...is there somethign i need to add to your mod to make it work....?

Thanks

mismouss 04-28-2008 10:52 PM

Re: Pictures in recommends.tpl for 3 column format
 
Hello,

I have exactly the same problem. I use also the Telafirma Images Mod.

This mod causes me problems for each other module which uses the images. For example, module RSS Export of Magneticone which uses the initial format of the images. I have enormous images; I cannot thus generate a Rss flow. If I do not find script returning to the images (cached directory) create by the module of Telafirma, I give up this module because I have many other modules using the images.

I should not be and would not be the only one to have this problem. Telafirma must find a solution.

David

EN4U 04-28-2008 11:21 PM

Re: Pictures in recommends.tpl for 3 column format
 
Quote:

Originally Posted by mismouss
Hello,

I have exactly the same problem. I use also the Telafirma Images Mod.

This mod causes me problems for each other module which uses the images. For example, module RSS Export of Magneticone which uses the initial format of the images. I have enormous images; I cannot thus generate a Rss flow. If I do not find script returning to the images (cached directory) create by the module of Telafirma, I give up this module because I have many other modules using the images.

I should not be and would not be the only one to have this problem. Telafirma must find a solution.

David


Im glad to hear im not the only one with issues David...... I hope something can be done about this as i would like to use the reccommended and related with images as moondog posted.

Unlike you David, i have yet to come across other areas of concern with the image mod......

I hope there wont be issues with this mod in the future.....

sunset 04-30-2008 11:31 PM

Re: Pictures in recommends.tpl for 3 column format
 
Thanks again MoonDog - fabulous!

EN4U 05-01-2008 03:28 AM

Re: Pictures in recommends.tpl for 3 column format
 
For anyone using the telafirma image mod and would like this on there system ive posted both the recommended and the related versions from moondog BUT with the call that will work with that image mod.

Quote:


{* $Id: related_products.tpl,v 1.15 2005/12/07 14:07:32 max Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$product_links}
{if $product_links[cat_num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=cat_num loop=$product_links}
{if %cat_num.first%}
<table border=0 width="100%">
<tr>
{/if}
{if $smarty.section.cat_num.index is div by 3}
</tr><tr valign="top">
{/if}
<td width=33% align=center valign=top class="PListCell" style="border: 2px dashed #cccccc;">
<a href="product.php?productid={$product_links[cat_num].productid}" class="ItemsList">{$product_links[cat_num].product}</a><br />
<a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>
{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=$config.Appearance.thumbnail_width tmbn_url=$product_links[cat_num].tmbn_url}</a>
<br />
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[cat_num].price}</font>
{if $product.taxes}<font class="ProductPriceVatRelated">
{include file="customer/main/taxed_price.tpl"
taxes=$product.taxes}</font>
</td>
{/if}
{if %cat_num.last%}
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title="Related products" content=$smarty.capture.dialog extra="width=100%"}
{else}
{capture name=dialog}
No related products.
{/capture}
{/if}




Quote:


{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
{assign var="tmp" value="0"}
{section name=num loop=$recommends}
{if $recommends[num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=num loop=$recommends}
{if %num.first%}
<table border=0 width="100%">
<tr>
{/if}
{if $smarty.section.num.index is div by 3}
</tr><tr valign="top">
{/if}
<td width=33% align=center valign=top class="PListCell";>
<a href="product.php?productid={$recommends[num].productid}" class="ItemsList">{$recommends[num].product}</a>
<br />
<a href="product.php?productid={$recommends[num].productid}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x=$config.Appearance.thumbnail_width tmbn_url=$recommends[num].tmbn_url}</a>
<br />
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].taxed_price}</font>
</td>
{if %num.last%}
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No recommends with this product.
{/capture}
{/if}




--------- Thanks Telafirma for the help setting this up......

hubbell 05-19-2008 07:00 AM

Re: Pictures in recommends.tpl for 3 column format
 
Thanks EN4U that is exactly what I was looking for. Also thanks to everyone else including Telafirma for your hard work!

paul@dimoda.com.au 05-24-2008 07:26 AM

Re: Pictures in recommends.tpl for 3 column format
 
I am also using the telafirma image mod on 4.17 and just updated my related_products.tpl as per post 73 above, but none of my images show in the related products. Did I miss something??

Sherif Nassar 06-03-2008 05:34 PM

Re: Pictures in recommends.tpl for 3 column format
 
I certainly have to thank the wonderful people helping on this forum. I am not technically qualified and I was able to make the mod very easily. It works great with version 4.1.10 as I am still setting up my store. I made a small change to MoonDog's(Super Guy) code . I made it in 4 columns. Also you can control the size of the thumbnail by changing the value image_x="80" you can find it about in the middle. His code fits it in the whole space, I just enjoy the flexibility to change according to the look and feel i want. Here is recommends.tpl that I am using

{* $Id: recommends.tpl,v 1.9 2006/03/21 07:17:18 svowl Exp $ *}
{if $recommends}
{capture name=recommends}
{assign var="tmp" value="0"}
{section name=num loop=$recommends}
{if $recommends[num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=num loop=$recommends}
{if %num.first%}
<table border=0 width="100%">
<tr>
{/if}
{if $smarty.section.num.index is div by 4}
</tr><tr valign="top">
{/if}
<td width=25% align=center valign=top class="PListCell";>
<a href="product.php?productid={$recommends[num].productid}" class="ItemsList">{$recommends[num].product}</a>
<br />
<a href="product.php?productid={$recommends[num].productid}">{include file="product_thumbnail.tpl" productid=$recommends[num].productid image_x="80" product=$recommends[num].product type="T"}</a>
<br />
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$recommends[num].taxed_price}</font>
</td>
{if %num.last%}
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra='width="100%"'}
{else}
{capture name=dialog}
No recommends with this product.
{/capture}
{/if}

paul@dimoda.com.au 06-03-2008 06:42 PM

Re: Pictures in recommends.tpl for 3 column format
 
Here is my related_products.tpl using the instructions in post 73 above.

Something is not working in the image url as the images are not showing at all for related products:

eg: {* $Id: related_products.tpl,v 1.15 2005/12/07 14:07:32 max Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
{assign var="tmp" value="0"}
{section name=cat_num loop=$product_links}
{if $product_links[cat_num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=cat_num loop=$product_links}
{if %cat_num.first%}
<table border=0 width="100%">
<tr>
{/if}
{if $smarty.section.cat_num.index is div by 3}
</tr><tr valign="top">
{/if}
<td width=33% align=center valign=top class="PListCell" style="border: 2px dashed #cccccc;">
<a href="product.php?productid={$product_links[cat_num].productid}" class="ItemsList">{$product_links[cat_num].product}</a><br />
<a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>
{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_x=$config.Appearance.thumbnail_width tmbn_url=$product_links[cat_num].tmbn_url}</a>
<br />
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[cat_num].price}</font>
{if $product.taxes}<font class="ProductPriceVatRelated">
{include file="customer/main/taxed_price.tpl"
taxes=$product.taxes}</font>
</td>
{/if}
{if %cat_num.last%}
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title="Related products" content=$smarty.capture.dialog extra="width=100%"}
{else}
{capture name=dialog}
No related products.
{/capture}
{/if}

Anyone have any suggestions

Sherif Nassar 06-09-2008 04:07 PM

Re: Pictures in recommends.tpl for 3 column format
 
Dear All,

I have just done it for upselling links in 4 columns and it works with 4.1.10. Here is the code for related_products.tpl

{* $Id: related_products.tpl,v 1.15.2.1 2007/05/02 06:05:39 max Exp $ *}
{if $product_links ne ""}
{capture name=related_products}
{assign var="tmp" value="0"}
{section name=cat_num loop=$product_links}
{if $product_links[num].productid}{assign var="tmp" value="1"}{/if}
{/section}
{section name=num loop=$product_links}
{if %num.first%}
<table border=0 width="100%">
<tr>
{/if}
{if $smarty.section.num.index is div by 4}
</tr><tr valign="top">
{/if}
<td width=25% align=center valign=top class="PListCell";>
<a href="product.php?productid={$product_links[num].productid}" class="ItemsList">{$product_links[num].product}</a>
<br />
<a href="product.php?productid={$product_links[num].productid}">{include file="product_thumbnail.tpl" productid=$product_links[num].productid image_x=$config.Appearance.thumbnail_width product=$product_links[num].product type="T"}<br /><br />{$lng.lbl_see_details}</a>
<br /><br />
<font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$product_links[num].taxed_price}</font>
</td>
{if %num.last%}
</tr></table>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.related_products extra='width="100%"'}
{else}
{capture name=dialog}
No related products with this product.
{/capture}
{/if}

aimeea 06-30-2008 07:46 PM

Re: Pictures in recommends.tpl for 3 column format
 
Is there a way to make relatedproducts and recommended products both show at the same time?

If I have a related product entered it wil not show recommends.

Thank you for any help.

JWait 07-06-2008 06:58 AM

Re: Pictures in recommends.tpl for 3 column format
 
Quote:

Originally Posted by aimeea
Is there a way to make relatedproducts and recommended products both show at the same time?

If I have a related product entered it wil not show recommends.

Thank you for any help.


Are you sure you have the modules configured correctly? I don't see anything in customer/product.tpl that would cause that to happen.

Code:

{if $active_modules.Upselling_Products ne ""}
<br />
{include file="modules/Upselling_Products/related_products.tpl" }
{/if}
{if $config.Appearance.send_to_friend_enabled eq 'Y'}
<br />
{include file="customer/main/send_to_friend.tpl" }
{/if}
{if $active_modules.Recommended_Products ne ""}
<br />
{include file="modules/Recommended_Products/recommends.tpl" }
{/if}


Note - this is from a 4.1.8 version of x-cart but I don't think there is a difference between recent versions.


All times are GMT -8. The time now is 05:38 PM.

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