Created
February 22, 2013 19:23
-
-
Save Tetsuro/5015903 to your computer and use it in GitHub Desktop.
Related products by Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="coll-product-list"> | |
{% capture current_handle %}{{ product.handle }}{% endcapture %} | |
{% capture current_type %}{{ product.type }}{% endcapture %} | |
{% assign how_many_we_got = 0 %} | |
{% paginate collections.all-products.products by 100 %} | |
{% for product in collections.all-products.products %} | |
{% unless product.handle == current_handle %} | |
{% if product.type == current_type and how_many_we_got < 4 %} | |
{% assign how_many_we_got = how_many_we_got | plus: 1 %} | |
{% include 'snippet-product-item' with 'four' %} | |
{% endif %} | |
{% endunless %} | |
{% endfor %} | |
{% endpaginate %} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment