X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Hide related items if quantity = 0 (https://forum.x-cart.com/showthread.php?t=19186)

cotc2001 01-11-2006 02:04 AM

Hide related items if quantity = 0
 
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}
******************}


balinor 01-11-2006 03:36 AM

Someone was just talking about this the other day...might want to see if you can borrow their file :)

http://forum.x-cart.com/viewtopic.php?t=25448

cotc2001 01-11-2006 03:43 AM

Cheers PM'd but i'll ask x-cart team as well just in case its a file that they don't want distributed

EDIT: Apparently the fixed file is in the 4.0.18 distro - so if anyone else is having the same problem then just download and replace with that version (of course backup your original first just in case you need to swap back)

JWait 01-24-2006 01:23 PM

Hmmm... where is the 4.0.18 Distributive? It doesn't show at the help desk?

cotc2001 01-24-2006 01:26 PM

Perhaps x-cart team mistyped when the emailed me and they meant .17


All times are GMT -8. The time now is 12:15 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.