Remove shopify pagination

Highlighted
Explorer
63 0 23

I am trying to remove shopify's pagination so that I can custom create my own. I removed all the paginate tags from my collection.liquid but my colelctions are being paginated regardless. Here is the code from my collection.liquid template:

{% assign has_sidebar = false %}
{% assign has_crumbs = true %}
<div class="row">
  <div class="columns small-10 small-push-1">
    {% include 'settings' %}
    {% include 'page-header-collection' with collection.title %}
    {% include 'content-wrap-open' %}
    {% include 'content-open' %}

    {% if settings.collection_display_browse? %}
      {% include 'collection-tag-filter' %}
    {% endif %}

    {% if collection.description and collection.description.size > 0 %}
      <div class="collection-description">{{ collection.description }}</div>
    {% endif %}


    {% if collection.products.size > 0 %}
      <div id="content" > 
        <div class="products cards">
          <ul class="block-grid small-block-grid-1 medium-block-grid-{{settings.collection_products_per_row_medium}} large-block-grid-{{settings.collection_products_per_row_large}}">

          {% for product in collection.products  %}
        
              <li class="{{ product.tags }}">
                {% include 'product-small' %}
              </li> 

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

  

      {% else %}
        <p class="empty">{{ 'collections.collection.empty_html' | t }}</p>
      {% endif %}
    </div>

    {% include 'content-close' %}
    {% include 'content-wrap-close' %}
  </div>
</div>

 

What am I missing?

1 Like
Highlighted
Shopify Expert
9871 99 1707

Removing pagination tags from a collection template does not mean that all products will show. A collection template with a layout will return at most 50 items. This is regardless of if you have the paginate tags in place or not.

If you're hoping to show more than 50 items on a page you'd need to keep the pagination in place, and use JavaScript to grab the remain page(s) of products. Once you've gathered up all the items you could then initialize whatever custom JavaScript pagination you need.

You could also use a template without a layout, eg: {% layout none %}. When a use a layout-less template you can return up to 1000 items at once. The usage for a layout-less template is more for creating data feeds like JSON, XML, etc.

This sounds familiar - do you have other posts with the same question? Hopefully I am not answering a question you've already asked somewhere else!

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Explorer
63 0 23

Thank you, Jason! No one else has been able to provide that info! I just tried using the layout none trick you mentioned but not having luck: 

 

{% layout none  %}
{% assign loop_index = 0 %}
{% for product in collections.cribs.products  %}

  {% capture loop_index %}{{ loop_index | plus:1 }}{% endcapture %}
 
{% endfor %}
<div>
	{{ loop_index }}
</div>
<div>
	{{ collections.cribs.all_products_count }}
</div>

All_products_count returns "95" but looping through collection.products still gives me 50 :/

In terms of keeping the pagination and retrieving the other pages's data with javascript, I hadnt thought of that either! So would you recommend creating a new parameter to hold my custom pagination and leave the "?page=" parameter for the default pagination?

0 Likes
Highlighted
New Member
2 0 0

Hey Tatiana, 

Did you ever figure this out? I am trying to do this for textureclothing.com

0 Likes
Highlighted
Shopify Expert
13 0 2

Hi @Jason hopefully you still see this even this was from 2016, "use JavaScript to grab the remain page(s) of products. " Your old message. 
Im just wondering how that works as I dont see the remaining search results after the 50 rendering on the front end so how are we going to get the remaining, Ajax? sorry I tried looking for that I cannot find a nice document will you help me, I am only able to use cart's ajax but not yet search? 

0 Likes
Highlighted
New Member
1 0 0

Oh man this is killing me.. 

I just need a simple answer - i want to remove pagination. 
The theme i'm using doesnt have this file: collection-template.liquid 
Most of the guidance i find relates to themes with that file.
Can anyone help me?

0 Likes