In my email template I need to be able to show som...
# advancedpdf
p
In my email template I need to be able to show some text if the invoice value is less than $ 5,000. When I add the following code though I get an error:
Copy code
<#if transaction.total < 5000>Total is over 5K</#if>
And the error I get is:
Can't compare values of these types. Allowed comparisons are between two numbers, two strings, two dates, or two booleans.
How can I fix this?
z
Not sure, but I think that total is not simple number (float), but a currency. In that case, total is converted into texr before "printing"...
p
That seems to be the case. Converting the contents to a number using ?number did not work either. For now I created a custom field with a formula that sees if the total is over 5k. If it is the field value becomes a text. I then use ?has_content in my template for that field and put my code in there. Hackish but it works.
c
should just be "lt" and not %lt;
would be curious if < is working
p
"lt" did not work either. It worked in preview but when I try and save the template I get the error.