| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
If Statements | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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 |
|||||||
#2
|
|||||||||
|
|||||||||
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) |
|||||||||
|
|||
X-Cart forums © 2001-2020
|