Skip to content

Instantly share code, notes, and snippets.

@tiagomatos
Created March 2, 2018 16:16
Show Gist options
  • Save tiagomatos/2e57d5047e61b0bd950e060b600ebb2d to your computer and use it in GitHub Desktop.
Save tiagomatos/2e57d5047e61b0bd950e060b600ebb2d to your computer and use it in GitHub Desktop.
Products from the same Product's Sub-Category
{% for vina_cat in store.category['vinas'].subcategories %}
{% for product_cat in product.categories %}
{% if vina_cat.id == product_cat.id %} // identify the vina category (monos)
{% assign cat = vina_cat %}
{% endif %}
{% end %}
<h2>{% t 'Wines from the same vineyard' %}</h2>
{% for prod in cat.products limit:8 %}
{% continue if prod.id == product.id %}
{{ product.name }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment