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

If Statement Help Needed

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-24-2008, 06:31 AM
  photo's Avatar 
photo photo is offline
 

X-Wizard
  
Join Date: Feb 2006
Location: UK
Posts: 1,146
 

Default If Statement Help Needed

I am using the following if statement but would like to add other categories to it so that it would show in catagory 6 and 12. What is the proper way to do this?
Code:
{if $product.categoryid eq "6"}{/if}

Thanks
__________________
v4.1.10
In Dev v4.5.x


"If you don't keep an eye on your business, someone else will."
Reply With Quote
  #2  
Old 06-24-2008, 06:54 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: If Statement Help Needed

Quote:
Originally Posted by photo
Code:
{if $product.categoryid eq "6"}{/if}
Code:
{if $product.categoryid eq "6" or $product.categoryid eq "12"} Do This {/if}

CAN YOU USE this instead?

Code:
{if $cat eq "6" or $cat eq "12"}
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #3  
Old 06-24-2008, 07:12 AM
  photo's Avatar 
photo photo is offline
 

X-Wizard
  
Join Date: Feb 2006
Location: UK
Posts: 1,146
 

Default Re: If Statement Help Needed

Thanks Jeremy, that worked. It ended up looking like this,

Code:
{if $cat eq "7" or $cat eq "8" or $cat eq "9" or $cat eq "12"}

hopefully this is the most efficient method.
__________________
v4.1.10
In Dev v4.5.x


"If you don't keep an eye on your business, someone else will."
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 04:14 AM.

   

 
X-Cart forums © 2001-2020