Hello.
I have tried so many times to get this bar that shows how many products on each product page. Does any one know how to do this. No one have the right code..
A user is attempting to add a prominent bar displaying product counts on collection pages but hasn’t found working code despite multiple attempts. The desired element is a large, visually distinct bar (shown in an attached screenshot).
Initial Solution Provided:
main-collection-product-grid.liquidCurrent Status:
Hello.
I have tried so many times to get this bar that shows how many products on each product page. Does any one know how to do this. No one have the right code..
Hi @silenceclothing ,
Go to Online Store > Themes > Actions > Edit Code > main-collection-product-grid.liquid
Find ‘facet-filters sorting caption’ then add below code just above this div tag
{%- if collection.results_count -%}
{{ 'templates.search.results_with_count' | t: terms: collection.terms, count: collection.results_count }}
{%- elsif collection.products_count == collection.all_products_count -%}
{{ 'products.facets.product_count_simple' | t: count: collection.products_count }}
{%- else -%}
{{ 'products.facets.product_count' | t: product_count: collection.products_count, count: collection.all_products_count }}
{%- endif -%}
Out put
this is not what i want. look at the picture, its a big bar.
Could you please share your store URL..