Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Hide related items if quantity = 0

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-11-2006, 02:04 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default 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} ******************}
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #2  
Old 01-11-2006, 03:36 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 01-11-2006, 03:43 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

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)
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #4  
Old 01-24-2006, 01:23 PM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default

Hmmm... where is the 4.0.18 Distributive? It doesn't show at the help desk?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #5  
Old 01-24-2006, 01:26 PM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Perhaps x-cart team mistyped when the emailed me and they meant .17
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020