Elkfox / Ajaxinate

🎡 Ajax pagination plugin for Shopify themes

Home Page:https://ajaxinate.elkfox.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicates Collection in Shopify

estebangallego opened this issue · comments

Describe the bug
Once you start scrolling and at the last product, it will duplicate all the products again and again.

To Reproduce
Steps to reproduce the behavior:

  1. Scroll down
  2. At the last product in the collection, the batch of products will repeat with no stop

Expected behavior
Stop scrolling at the last product

Link
https://honorthegift.co/collections/accessories

Additional context
Please help solving this bug

This is likely because you had paginate.previous and/or paginate.parts in Pagination block.
It works for me after I removed those two, leaving only paginate.next like shown in the docs:

{% paginate collection.products by 3 %}
    <div id="AjaxinateContainer" >
      {% for product in collection.products %}
        {% include 'product-grid-item' %}
      {% endfor %}
    </div>

    <div id="AjaxinatePagination">
      {% if paginate.next %}
        <a href="{{ paginate.next.url }}">Loading More</a>
      {% endif %}
    </div>
{% endpaginate %}