Either/or conditions for IF statement

Subscribe to Either/or conditions for IF statement 2 post(s), 2 voice(s)

 
Avatar Heather 6 post(s)

I am trying to format line items in the invoice template based on the value of the title. The code I am using that I think should work isn’t. I want to apply formatting if the title is any one of a number of different values. The code works just fine for the first value, it doesn’t apply the formatting for the second value though. Can someone please help?

Here is my code:
<td class="first">
{% if item.title == ‘Training’ || item.title == ‘Discounts’ %}


{{ item.title }}

{% else %} {{ item.title }} {% endif %} </td>

Thanks!

 
Avatar Seth - Subim... Administrator 384 post(s)

That code is just printing out the title both times and would be the same thing regardless of the content.

Is that your real code or are you doing something else in your template?