Liquid | If statement works in App but not in Notifications

Hello Team

I’ve got a little quandary and I can’t figure it out.
I have the same If statement that works in Order Printer Pro, but does not work in Notifications (Shipping Confirmation).

This intention is that if 300 is selected as a sku variant (rate) to highlight this on the email. I decided to pull it from the SKU title and it works well in Order Printer Pro. But it for shipping confirmation the exact same code in notifcations returns the {% else %} clause every time.

{% assign sorted_line_items = line_items | sort: ‘sku’ %}
{% for line_item in sorted_line_items %}
{% if line_item.name contains ‘300’ %}
enhanced 300 rate has been selected
{% else %}
standard 180 rate has been selected
{%endif%}
{% endfor %}

I’m sure there’s an obvious mistake / better way to do it… any help would be appreciated :slightly_smiling_face:

Thanks

Chris

Hey @Chris_West ! I’m not an expert in Liquid or especially anything order related, but I took a quick look at the Liquid documentation for line_items and I do not see a name property. Maybe try line_item.title? https://shopify.dev/docs/api/liquid/objects/line_item

@Brett_Helium

Thank you… kicking myself I failed to spot it.
But you are right.