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

If Statements

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-20-2009, 10:55 AM
 
1day2004 1day2004 is offline
 

Senior Member
  
Join Date: Dec 2004
Posts: 115
 

Default If Statements

I know you can use eq (equals) and ne (not equals) for if statements.

Is there also a method for checking to see if it 'contains' a certain text?

Example:
{if $user_membership ne "Reseller 20% Discount" and $user_membership ne "Reseller 25% Discount" and $user_membership ne "Reseller 30% Discount" and $user_membership ne "Reseller 35% Discount"}

'Reseller' is common with all these membership types.

Is it possible to simplify this code?

Thanks
__________________
Version 4.0.8 Live
Reply With Quote
  #2  
Old 05-20-2009, 03:55 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: If Statements

If you want to exclude anything where the first 8 characters are reseller, you could try:
{if $user_membership|substr:0:7 ne "Reseller"}
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > 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:41 AM.

   

 
X-Cart forums © 2001-2020