![]() |
Re: Pictures in recommends.tpl for 3 column format
Tuan,
Thanks for your post #37. Worked great on 4.1.3! |
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) { Code:
if ($product_links) { |
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 |
Re: Pictures in recommends.tpl for 3 column format
Quote:
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. |
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} |
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! |
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} |
Re: Pictures in recommends.tpl for 3 column format
Thank you for the code, works great!
Mark |
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?
|
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!! |
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 |
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?
|
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} |
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 $ *} |
Re: Pictures in recommends.tpl for 3 column format
Quote:
That would be great, but I haven't seen it done. |
Re: Pictures in recommends.tpl for 3 column format
Quote:
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. |
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. |
Re: Pictures in recommends.tpl for 3 column format
Quote:
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. |
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 |
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 |
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. |
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 $ *} - MoonDog - |
Re: Pictures in recommends.tpl for 3 column format
MoonDog,
It works like a charm! Thank you so much! It looks great. |
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!!! |
Re: Pictures in recommends.tpl for 3 column format
It works great Moondog. You are my hero!
|
Re: Pictures in recommends.tpl for 3 column format
Great work Moondog!!
|
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!
|
Re: Pictures in recommends.tpl for 3 column format
Hi m28m,
Code:
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 - |
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 |
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 |
Re: Pictures in recommends.tpl for 3 column format
Quote:
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..... |
Re: Pictures in recommends.tpl for 3 column format
Thanks again MoonDog - fabulous!
|
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:
Quote:
--------- Thanks Telafirma for the help setting this up...... |
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!
|
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??
|
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} |
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 |
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} |
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. |
Re: Pictures in recommends.tpl for 3 column format
Quote:
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 ""} 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.