The below expression is not making sense to me. I'm having a hard time understand why it will result in "free shipping". Can someone elaborate on the explanation?
%%[
var @statusTier, @amount, @freeShipping
set @statusTier = "Bronze"
set @amount = 300
if @statusTier == "Bronze" or @statusTier == "Silver" and @amount > 500 then
set @freeShipping = true
endif
]%%
<p>You %%=Iif(@freeShipping == true, "qualify","do not qualify")=%% for free shipping.</p>
Output:
The join operators in the above if statement will be evaluated as a single expression and will produce the following result:
<p>You qualify for free shipping.</p>
From my understanding the set amount of 300 is not > 500 therefore this should not have been a true statement and should output "You do not qualify for free shipping.". I'm a missing something here? Please help, I'm a newbie to AMPscript with little knowledge to JavaScript.
Original THE AMPSCRIPT GUIDE post: https://ampscript.guide/controlling-expression-evaluation/
Thank you for you input in advance!