Hi, I'm trying to use multiple conditions, but it'...
# advancedpdf
m
Hi, I'm trying to use multiple conditions, but it's not working. Can you spot any issues with this? <#if tax.taxcode=="NL_ZR 0%" || tax.taxcode=="NL_SR 21%" || tax.taxcode=="NL_RCS 0%" && record.shippingaddress.country=="Austria" > <tr> <td>Text</td>
d
Is it not working as in throwing an error, or as in not expected output? If the latter, it may be to do with Operator precedence. Freemarker processes
&&
before
||
, which is equivalent to:
Copy code
<#if taxCodeExpr1 || taxCodeExpr2 || (taxCodeExpr3 && isAustria)>
use parenthesis to group your tax code expressions:
Copy code
<#if (taxCodeExpr1 || taxCodeExpr2 || taxCodeExpr3) && isAustria>
m
Thanks @David B it works now. 👍