Skip to content

Instantly share code, notes, and snippets.

@zakhardage
Created September 17, 2014 15:50
Show Gist options
  • Select an option

  • Save zakhardage/9c48788ad76588d7d2d8 to your computer and use it in GitHub Desktop.

Select an option

Save zakhardage/9c48788ad76588d7d2d8 to your computer and use it in GitHub Desktop.
Wishlist Item Count
{% if customer %}
{% for tag in customer.tags %}
{% assign t = tag | remove:'x' %}
{% unless tags contains t %}
{% capture tags %}{{ tags }} {{ t }}{% endcapture %}
{% endunless %}
{% endfor %}
{% for collection in collections %}
{% paginate collection.products by collection.all_products_count %}
{% for product in collection.products %}
{% if tags contains product.id %}
{% assign wishlist-count = wishlist-count | plus:1 %}
{% endif %}
{% endfor %}
{% endpaginate %}
{% endfor %}
{% if wishlist-count > 0 %}
Wishlist: {{ wishlist-count }}
{% endif %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment