← Back to Snippets
Collection Product Count
Displays the total number of products in a collection. Simple one-liner snippet with clean styling that integrates into any collection page layout.
snippets/plynthr-collection-count.liquid
{% comment %}
Plynthr — Collection Product Count
https://plynthr.com/snippets/collection-product-count/
INSTALL:
1. Create snippets/plynthr-collection-count.liquid
2. Paste this code
3. Add {%- render 'plynthr-collection-count' -%} on your collection template
{% endcomment %}
<style>
.plynthr-collection-count {
font-size: var(--pcc-font-size, 13px);
color: var(--pcc-color, #999);
margin: 8px 0 16px;
font-weight: 500;
}
.plynthr-collection-count__num {
font-weight: 700;
color: var(--pcc-num-color, #666);
font-variant-numeric: tabular-nums;
}
</style>
{%- if template.name == 'collection' -%}
<p class="plynthr-collection-count">
<span class="plynthr-collection-count__num">{{ collection.products_count }}</span>
{{ collection.products_count | pluralize: 'product', 'products' }}
</p>
{%- endif -%}
Installation
- In your Shopify admin, go to Online Store → Themes → Edit Code
- Under Snippets, click "Add a new snippet"
- Name it
plynthr-collection-count - Paste the code above and save
- Open your collection template (e.g.,
sections/main-collection.liquid) - Add
{%- render 'plynthr-collection-count' -%}below the collection title or above the product grid
Customization
--pcc-color— Text color (default: #999)--pcc-num-color— Number color (default: #666)--pcc-font-size— Font size (default: 13px)- Add additional info like
{{ collection.description }}alongside the count
Want this installed for you?
I'll add this to your Shopify store, test it, and make sure it's working perfectly. Done within 24 hours.
Install for Me — $29
✓ Installed & tested
✓ Within 24 hours
✓ Any OS 2.0 theme
FAQ
Does this count filtered products?
No.
collection.products_count returns the total number of products in the collection regardless of active filters. For filtered counts, you'd need JavaScript.Can I show this on the home page?
Yes. Use
{%- for collection in collections -%} to loop through collections and display their counts.Does it update in real time?
It updates on each page load. When you add or remove products from a collection in admin, the count reflects the change on the next page view.