Tag Archives: if

IF macro

The IF macro will check the logical condition of a statement and return one value if true and a different value if false.



%IF(condition, value-if-true, value-if-false)%


available operators (in condition)  :

<> Not equal
<= Less than or equal to
=> Greater than or equal to
= equal
< Less than
> Greater than
&&      And
|| Or


only one condition at time is allowed


some examples:

%IF(%sale_price% = ,%price%,%price% SALE: %sale_price%)%

(display sale price when available, otherwise display normal price)


%IF(%%price%% < 1.00, Budget Price , )%

(displays text "Budget Price" when price is lower < 1)


%IF(%short_description%=,There is no short description for this item!,)%

(displays text when short_description field is empty)



Print  posted by miro   General tags:  • macros • if   permalink
0 0