0
votes

The issue is odd- on a collection page where we show all products separated by their product types, the page only shows around 80% of the total. There is no limit hit on any page yet, and when we click through to a product_type page, all products are clearly there.

Here's the .liquid theme file we are using now-

{% if collection.handle %}
  <!-- basic collection -->
  <!-- sorting by product type within collection (with titles) -->
  {% assign sorted_by_type = collection.all.products | sort: 'type' %}

  {% for product_type in collection.all_types %}
  <div class="products clearfix collection">
      {% assign the_type = product_type %}
      <h2>{{ the_type | link_to_type }}</h2>
      {% paginate collections.all.products by 2000 %}
        {% for product in collections.all.products %}
          {% if product.type == the_type %}
            {% include 'product-loop' %}
          {% endif %}
        {% endfor %}
      {% endpaginate %}
  </div>
  {% endfor %}

{% else %}
  <!-- vendor -->
  {% assign image_name = collection.title | handleize | append: '.jpg' %}
  <div class="banner my-backstretch" data-vendorname="{{ collection.title | handleize }}" data-src="{{ image_name | asset_url }}"></div>

  <!-- sorting by product type within vendor (with titles) -->
  {% assign sorted_by_type = collection.products | sort: 'type' %}

  {% for product_type in collection.all_types %}
  <div class="products clearfix collection">
      {% assign the_type = product_type %}
      <h2>{{ the_type | link_to_type }}</h2>
      {% paginate collection.products by 2000 %}
        {% for product in collection.products %}
          {% if product.type == the_type %}
        {% include 'product-loop' %}
          {% endif %}
        {% endfor %}
      {% endpaginate %}
  </div>
  {% endfor %}
{% endif %}

Any help or assistance pinpointing this error would be great! Not super familiar with Shopify yet.

1

1 Answers

0
votes

Even though you're telling it to paginate by 2000 products, you're still going to be limited to 50.

See here in the Shopify docs for more info:

{% paginate collection.products by 9 %}

In the above example, the number is 9 but in your theme, that number could be 6 or 12, or anything else that is smaller or equal to 50. This number corresponds to the number of products showcased per page.

Edit that number to increase or decrease the number of products shown per page. Do not ever paginate by more than 50.