I’ve been attempting to use basic line item conditions in my order confirmation email but I consistently receive no output in my test emails.
I feel like I’m missing something fundamental because what I’m attempting seems trivial. I’ve been poking around the forums and YouTube but I can’t seem to get the right leads on this topic.
Below are some examples of basic conditions I’ve tried. Any help/tip is appreciated!
Example #1
{% if line.product.vendor contains 'Amazon' %}
Vendor is Amazon!
{% endif %}
Example #2
{% if line.product.title == 'Test' %}
Product's title is Test!
{% endif %}
Update:
After much testing I found that if I sandwiched the above examples between the following code it works!
{% for line in subtotal_line_items %}
{% endfor %}
Though I don’t know why. Thoughts anyone?