just having a fiddle with the related items module as I think when we had x-cart do the work something went missing.
what im trying to do is in related items that if a related item has a quantity of 0 then it is hidden from view
I presume it could be done with an if statement - any ideas on what the syntax would be though.
Also am i right in presuming that the if statement woud be placed before the {setion} or is it after it???
this is the current code so any help would be appreciated.
Code:
{* $Id: related_products.tpl,v 1.10.2.1 2004/10/07 10:52:42 max Exp $ *}
<TABLE width=100% border=0>
{section name=cat_num loop=$product_links}
<TR><TD>
<TABLE width=100% border=0>
<TR>
<TD >
{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}
</TD>
<td width="93" valign="top" class="text"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" bgcolor="#E3E3E3" ><table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td>{$product_links[cat_num].product}
{$product_links[cat_num].descr|truncate:40}
more details </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="bottom" bgcolor="#E3E3E3" >[img]{$SkinDir}/hom/rpleft.gif[/img]</td>
<td bgcolor="#E3E3E3" ></td>
<td align="right" valign="bottom" bgcolor="#E3E3E3" >[img]{$SkinDir}/hom/rpright.gif[/img]</td>
</tr>
</table>
</td>
</TR>
<TR>
<TD></TD>
<td valign="top"></td>
</TR>
</TABLE>
</TD>
</TR>
{/section}
</TABLE>
{*****************
{if $product_links ne ""}
{capture name=dialog}
<TABLE border="0" 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.Modules.upselling_new_window eq 'Y'} target="_blank"{/if}>
{ $product_links[cat_num].product}
</A>
</TD>
</TR>
{/section}
</TABLE>
{/capture}
{include file="dialog.tpl" title=$lng.lbl_related_products content=$smarty.capture.dialog extra="width=100%"}
{/if}
******************}