public
Last active

related-by-tags.liquid (snippet for Solo theme)

  • Download Gist
gistfile1.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
{% if product.tags.size > 0 %}
<!-- START RELATED -->
<div id="related">
<h6>{% if settings.related.size > 0 %}{{ settings.related | escape }}{% else %}Take a look at these great accessories:{% endif %}</h6>
<!-- START SLIDER -->
<div id="slider" class="clear">
<!-- START PREV -->
<div id="prev">
<p><a href="/collections/all" class="inactive">Previous</a></p>
</div>
<!-- END PREV -->
<!-- START WINDOW -->
<div id="window">
<ul class="clear">{% paginate collections.all.products by 1000 %}{% for prod in collections.all.products %}{% if product.tags contains prod.title %}
<li>
<div class="image clear">
<a href="{{ prod.url | within: collections.all }}"><img src="{{ prod.images[0] | product_img_url: "small" }}" alt="{{ product.title | escape }}" /></a>
</div>
<h4><a href="{{ prod.url | within: collections.all }}">{{ prod.title | escape }}</a></h4>
<p>{{ prod.price | money }}</p>
</li>{% endif %}{% endfor %}{% endpaginate %}
</ul>
</div>
<!-- END WINDOW -->
<!-- START NEXT -->
<div id="next">
<p><a href="/collections/all">Next</a></p>
</div>
<!-- END NEXT -->
</div>
<!-- END SLIDER -->
</div>
<!-- END RELATED -->
{% endif %}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.