d
Topic
Posts:
3
March 06, 2014

New related product on product pages This post is outdated

hi!

my site is
https://the-pig-gallery.myshopify.com/. I created a new snippet to
show another block of related products on product pages.

The problem is that it only works in the first 50 products.This is the
code snippet.

<div class="row">
  <div class="span6">
    <h4 class="collection-title">También disponible en...</h4>
  </div>
</div>

<div class="row products">
{% assign title = product.title %}
{% assign handle = product.handle %}
{% for product in collections.all.products %}
  {% if title == product.title and handle != product.handle %}

    <a href="{{ product.url | within: collection }}" title="{{
product.title }}">
      <img src="{{ product.images.first | product_img_url: 'small' }}"
alt="{{ product.title }}" />
    </a>

  {% endif %}
{% endfor %}
</div>

What can be the problem?

Thanks for all, greetings.

i
Replies
Kylea Shopify Employee
Posts:
130
Last edited March 14, 2014

The maximum number of products you can show per page is 50. You would need to add in pagination: http://docs.shopify.com/themes/liquid-variables/paginate

Or, an infinite scroll function to pull more products onto the page when you scroll down: http://www.davecap.com/post/9675189741/infinite-scroll-for-shopify-collections

Posts:
3
March 15, 2014

thank you very much 
I'll try, and I tell you. 
Greetings.