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

How to use an "and" statement for 3 category menus

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-19-2009, 03:53 PM
 
zebu zebu is offline
 

eXpert
  
Join Date: Oct 2006
Posts: 310
 

Default How to use an "and" statement for 3 category menus

Hi, I have created 3 category menus

1st menu displays categories with a POS between 1 and 10
2st menu displays categories with a POS between 11 and 99
3rdt menu displays categories with a POS between 100 and 999

Menu 1 & 3 are working fine.

Just need some help on how to use an "and" statement for menu 2 to only show products between 11 and 99 for Category Position.

Code I have is below:

What I really want is something like : {if $c.order_by gt 10 and lt 100 }

But doesn't seem to work - any hints from a Guru?

HTML Code:
{foreach from=$categories item=c} {if $c.order_by lt 100 } <table width="100%" cellpadding="0" cellspacing="0" border="0" valign="top"> <tr valign="top"> <td width="100%" valign="top"> <a href="home.php?cat={$c.categoryid}" class="catnav"><b>{$c.category}</b></a> {foreach from=$allcategories item=cat key=catid} {if $cat.parentid eq $c.categoryid} <a href="home.php?cat={$catid}" class="catnav_sub">&nbsp;&nbsp;&rsaquo;&nbsp;{$cat.category}</a> {/if} {/foreach} </td> </tr> </table> {/if} {/foreach}

Cheers Zane
__________________
Version 4.7.7
Reply With Quote
  #2  
Old 11-19-2009, 03:56 PM
 
zebu zebu is offline
 

eXpert
  
Join Date: Oct 2006
Posts: 310
 

Default Re: How to use an "and" statement for 3 category menus

Managed to get it to work using two if statements. Is this the best way?

{if $c.order_by lt 100 }
{if $c.order_by gt 10 }
__________________
Version 4.7.7
Reply With Quote
  #3  
Old 11-20-2009, 06:11 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: How to use an "and" statement for 3 category menus

You were close. Try:

{if $c.order_by gt 10 and $c.order_by lt 100 }
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #4  
Old 01-11-2010, 07:09 AM
 
Chris B Chris B is offline
 

eXpert
  
Join Date: Oct 2002
Posts: 226
 

Default Re: How to use an "and" statement for 3 category menus

For 4.0x I'm looking to add a header to each of the broken out categories (Only if there are categories listed between the $categories[cat_num].order_by). Any ideas?

Here's my current code:

<p><font class="VertMenuTitleGold">Category Name One</font></p>
{section name=cat_num loop=$categories}
{if $categories[cat_num].order_by gt 200 AND $categories[cat_num].order_by lt 299}
<FONT class="CategoriesListCaps"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItemsWht">{$categories[cat_num].category}</A></FONT><BR>
{/if}
{/section}



<p><font class="VertMenuTitleGold">Category Name Two</font></p>
{section name=cat_num loop=$categories}
{if $categories[cat_num].order_by gt 300 AND $categories[cat_num].order_by lt 399}
<FONT class="CategoriesListCaps"><A href="home.php?cat={$categories[cat_num].categoryid}" class="VertMenuItemsWht">{$categories[cat_num].category}</A></FONT><BR>
{/if}
{/section}


Thanks...
__________________
4.0x - 4.5x
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 02:43 PM.

   

 
X-Cart forums © 2001-2020