Last active
May 22, 2019 16:39
-
-
Save hhayrapetyan/bb697ae50169da8ba500 to your computer and use it in GitHub Desktop.
Shopify Venture Theme Related products snippet
That helped me out also, Thanks!
good
You've saved me a great deal of time. Thanks for sharing this!
Thanks for sharing, works great!
Hi, Can anyone help? The code works great accept the spacing between the title and the related products is too wide. How can I make the spacing less?
Would really appreciate any help.
thanks
Quick question, would you know how i can change the below to make it show a maximum of only 4 related products?
{% if settings.display_related_products %}
{% capture limit %}{{ settings.products_per_row | plus: 1 }}{% endcapture %}
{% if collection and collection.all_products_count > 4 %}
{% assign col = collection.handle %}
{% else %}
{% assign col = product.collections.last.handle %}
{% endif %}
{% for tag in product.tags %}
{% if tag contains 'meta-related-collection-' %}
{% assign col = tag | remove: 'meta-related-collection-' %}
{% assign collection = collections[col] %}
{% capture limit %}{{ collection.products_count | plus: 1 }}{% endcapture %}
{% endif %}
{% endfor %}
{% if col and collections[col].all_products_count > 0 %}
<br class="clear" />
<br class="clear" />
<h4 class="title center">{{ 'products.product.related_items' | t }}</h4>
{% assign skip_product = product %}
{% assign products = collections[col].products %}
{% assign products_per_row = settings.products_per_row %}
{% include 'product-loop' with settings.product_sidebar %}
{% endif %}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great! Thank you mate!