Quote:
Originally Posted by balinor
For anyone who wants this to work for 4.0.18, here's the code to use:
Code:
{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="33%" 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>
{ $product_links[cat_num].product}
</A>
</TD>
{ if %cat_num.last% }
</tr></table><br>
{/if}
{/section}
{/capture}
{include file="dialog.tpl" title="You may also like..." content=$smarty.capture.dialog extra="width=100%"}
{/if}
It is set for 3 columns, but you can change that by changing the number 3 to whatever you want, and also change the percentage for the width of the table cell (currently set to 33%).
|
Balinor,
No one seems to have posted a clean version of this mod for Version 4.1.8
and i cant get this to work on mine no matter how many times I modify the codes (It still shows the same unglorious text). here is my related_products.tpl code:
Code:
{* $Id: related_products.tpl,v 1.15.2.1 2007/05/02 06:05:39 max Exp $ *}
{if $product_links ne ""}
{capture name=dialog}
<table cellspacing="5">
{section name=cat_num loop=$product_links}
<tr class="ItemsList">
<td width="1%">#{$product_links[cat_num].productid}</td>
<td width="99%"><a href="product.php?productid={$product_links[cat_num].productid}"{if $config.Upselling_Products.upselling_new_window eq 'Y'} target="_blank"{/if} class="ItemsList">{$product_links[cat_num].product|amp}</a></td>
</tr>
{/section}
</table>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra='width="100%"'}
{/if}
Can you please have a look at this and tell me what part do I have to modify to make it compatible with 4.1.8. (Or let me know if I have to make any changes in any other file)
Thanks,

V