Hello all and thanks in advance for any guidance.
I am setting up a “Recently Purchased” section based on a customer’s previous orders.
The below code successfully outputs the most recently purchased product along with some custom associated products based upon a product tag (works great)…
BUT, I cannot get it to output an {% else %} section (e.g. if customer orders has line item that contain specific tag show information else do X).
{% for order in customer.orders %}
{% for line_item in order.line_items %}
{% if line_item %}
You recently purchased
{{ line_item.title }}
{% endif %}
{% for tag in line_item.product.tags %}
{% if tag contains 'Mix'%}
Did you know?
{% include 'tag-sonic-mixes-descriptors' %}{% else %} Do X
{% break %}
{% endif %}
{% endfor %}
{% break %}
{% endfor %}
{% break %}
{% endfor %}
Thanks again.