![]() |
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!! |
All times are GMT -8. The time now is 04:08 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.