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

If statement with multiple categories
 
Reply
   X-Cart forums > X-Cart 4 > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-20-2011, 09:06 AM
 
someguy03 someguy03 is offline
 

Member
  
Join Date: Aug 2010
Posts: 16
 

Default If statement with multiple categories

I am using this if statement:

{if $cat eq "264"}
Code
{else}
Code
{/if}

But I want to have category 264, 271, 275, etc. How can I format the statement to have multiple category numbers?

Also, how can I have a negative if statement? So I can tell something to NOT display if it is a certain category.
__________________
X-Cart version 4.4
Reply With Quote
  #2  
Old 09-20-2011, 09:13 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: If statement with multiple categories

Quote:
Originally Posted by someguy03
I want to have category 264, 271, 275, etc. How can I format the statement to have multiple category numbers?
Really easy, you will laugh:
Code:
{if $cat eq "264" or $cat eq "271" or $cat eq "275"} Code {else} Code {/if}
Quote:
Originally Posted by someguy03
Also, how can I have a negative if statement? So I can tell something to NOT display if it is a certain category.
Again easy (thankfully):
Code:
{if $cat ne "264"} Code {/if}
Smarty is so simple and makes so much sense.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:58 PM.

   

 
X-Cart forums © 2001-2018