How to show total number of products in a collection

KRaatz
Tourist
8 0 4

@Alex-RightGeek 

 

Thank you so much, you are awesome. It work perfectly.

0 Likes
Alex-RightGeek
Shopify Partner
21 3 9

That's great to hear. Please like the comment.

I make custom Shopify pages & themes.. info@rgeekdigital.com
0 Likes
amitshopify
New Member
2 0 0

<strong> how can use the above code or where because it's not working in this nav code, please help to do that</strong>

<ul class="site-nav" id="AccessibleNav">
<li><a href="{{ child_level_2.url }}"><span>{{ child_level_2.title }} </span></a></li>
{% unless linklists[section.settings.menu].links.first.url == '/' %}

<li class="large--hide">
<a href="/">{{ 'general.breadcrumbs.home' | t }}</a>
</li>
{% endunless %}
{% for link in linklists[section.settings.menu].links %}
{% if link.links != blank %}
{% assign parent_index = forloop.index %}
<li style"background-color: #d0d0d0 !important;"
class="site-nav--has-dropdown {% if link.active %}site-nav--active{% endif %}"
aria-haspopup="true">
<a
href="{{ link.url }}"
class="site-nav--link"
data-meganav-type="parent"
aria-controls="MenuParent-{{ parent_index }}"
aria-expanded="false"
{% unless template.name == 'index' %}{% if link.active %}aria-current="page"{% endif %}{% endunless%}>
{{ link.title | escape }}
<span class="icon icon-arrow-down" aria-hidden="true"></span>
</a>



<ul
id="MenuParent-{{ parent_index }}"
class="site-nav--dropdown {% if link.levels == 2 %}site-nav--has-grandchildren{% endif %}"
data-meganav-dropdown>
{% for childlink in link.links %}
{% if childlink.links != blank %}
{% assign child_index = forloop.index %}



<li
class="site-nav--has-dropdown site-nav--has-dropdown-grandchild {% if childlink.active %}site-nav--active{% endif %}"
aria-haspopup="true">

<a
href="{{ childlink.url }}"
class="site-nav--link"
aria-controls="MenuChildren-{{ parent_index }}-{{ child_index }}"
data-meganav-type="parent"
{% unless template.name == 'index' %}{% if childlink.active %}aria-current="page"{% endif %}{% endunless%}
tabindex="-1">
{{ childlink.title | escape }}
<span class="icon icon-arrow-down" aria-hidden="true"></span>
</a>



<ul
id="MenuChildren-{{ parent_index }}-{{ child_index }}"
class="site-nav--dropdown-grandchild"
data-meganav-dropdown>
{% for grandchildlink in childlink.links %}
<li{% if grandchildlink.active %} class="site-nav--active"{% endif %}>
<a
href="{{ grandchildlink.url }}"
class="site-nav--link"
data-meganav-type="child"
{% unless template.name == 'index' %}{% if grandchildlink.active %}aria-current="page"{% endif %}{% endunless %}
tabindex="-1">
{{ grandchildlink.title | escape }}
</a>
</li>
{% endfor %}
</ul>
</li>

{% else %}


<li{% if childlink.active %} class="site-nav--active"{% endif %}>
<a
href="{{ childlink.url }}"
class="site-nav--link"
data-meganav-type="child"
{% if childlink.active %}aria-current="page"{% endif %}
tabindex="-1">
{{ childlink.title | escape }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% else %}
<li{% if link.active %} class="site-nav--active"{% endif %}>
<a
href="{{ link.url }}"
class="site-nav--link"
data-meganav-type="child"
{% unless template.name == 'index' %}{% if link.active %}aria-current="page"{% endif %}{% endunless%}>
{{ link.title | escape }}
</a>
</li>
{% endif %}
{% endfor %}

{% if shop.customer_accounts_enabled %}
{% if customer %}
<li class="customer-navlink large--hide"><a href="/account">{{ 'layout.customer.view_account' | t }}</a></li>
<li class="customer-navlink large--hide">{{ 'layout.customer.log_out' | t | customer_logout_link }}</li>
{% else %}
<li class="customer-navlink large--hide">{{ 'layout.customer.sign_in' | t | customer_login_link }}</li>
<li class="customer-navlink large--hide">{{ 'layout.customer.create_account' | t | customer_register_link }}</li>
{% endif %}
{% endif %}
</ul>

 

0 Likes
playcode3
New Member
4 0 0

How is this done? Where do you enter the code?

0 Likes
playcode3
New Member
4 0 0

I found where to put the code in collection.liquid however it is only showing the total in each page it does not change the "1 of XX" for each page, for example it shows "Showing Products 1 - 407 of 407" on each page. not something like 1 - 33 of 407. 

0 Likes