Need to display rest of product count on infinite scroll

New Member
4 0 0

Hi,

 

I want to display the rest of the product count on infinite scroll.

 

I get the number on page loading but when I click on Show More button it doesn't update the number.

Capture d’écran 2020-01-21 à 1.32.29 PM.png

 

{% if settings.collection_infinite_scrolling %}
{% assign restProducts = collection.all_products_count %}

  {% if paginate.next %}

    <div class="infinite-scrolling">
      <a class="btn" href="{{ paginate.next.url }}" {% if settings.enable_multilang %}data-translate="collections.general.show_more"{% endif %}>
        {{ 'collections.general.show_more' | t}}
        {% assign restProducts = restProducts | minus: cart.attributes.pagination %}
        {{ restProducts }}
      </a>
    </div>
  {% endif %}

 

 

Any help plz ?

 

Thks 

 

 

0 Likes