Quote:
Originally Posted by Online Michael
I don't know if you have fixed your problem or not so just in case, here is my solution (better late than never). Just replace the entire contents of your related_products.tpl file with this:
Code:
{* $Id: related_products.tpl,v 1.10.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="2" width="100%">
{/if}
{if $smarty.section.cat_num.index is div by 4}
<tr valign="top">
{/if}
<td width="{$product_links}%" align="center" valign="top">
{include file="product_thumbnail.tpl" productid=$product_links[cat_num].productid image_y=70 product=$product_links[cat_num].product tmbn_url=$product_links[cat_num].tmbn_url}
<a href="product.php?productid={ $product_links[cat_num].productid }"{if $config.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>
<font class="ProductTitle"> {$product_links[cat_num].product|escape}</font></a>
<FONT class="ProductDetailsTitle">{include file="currency.tpl" value=$product_links[cat_num].price}</FONT><FONT class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product_links[cat_num].price}</FONT>
</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}
You will notice that the code will center all related products very nicely accross your page regardless of wether you have 1 product or 4. If you want more products then replace 4 with whatever number you wish. The mod also includes price and alternate price. Just remove it if you don't need it. Hope this helps.
|
Thanks for the Mod Michael!!! Just what I was looking for. If this forum had a star system, you'd get a few from me!!