Skip to content

Instantly share code, notes, and snippets.

@joe-dempsey
Created January 6, 2017 10:31
Show Gist options
  • Save joe-dempsey/c5204a6fbad4536b0e0871028bb3d17b to your computer and use it in GitHub Desktop.
Save joe-dempsey/c5204a6fbad4536b0e0871028bb3d17b to your computer and use it in GitHub Desktop.
upsells in cart liquid
<h3>List collection handles (use for testing)</h3>
{% for item in cart.items %}
{% for collection in item.product.collections %}
<p>{{ collection.handle }}</p>
{% endfor %}
{% endfor %}
{% for item in cart.items %}
{% for collection in item.product.collections %}
{% if collection.handle == "double-prams" %}
{% assign double = true %}
{% break %}
{% endif %}
{% endfor %}
{% endfor %}
{% if double == true %}
<h1>Order contains item in collection double prams</h1>
{% else %}
<h1>Order doesn't contain item in collection double prams</h1>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment