'How to count current showing products in Shopify 2.0 dawn theme?
Solution 1:[1]
There is 2 modification in 2 files of dawn theme.
- in
facets.liquidfile add below code under the span idProductCountDesktop.
{% if next_link %}
{{ offset | plus: 1 }} - {{ offset | plus: page_size }} of
{% else %}
{% capture itemsOnCurrentPage %}
{{ results.all_products_count | minus: offset }}
{% endcapture %}
{% if results.all_products_count > 0 %}{{ offset | plus: 1 }}{% else %}{{ offset }} {% endif %}- {{ offset | plus: itemsOnCurrentPage }} of
{% endif %}
- now replace
render: facetswith below code inmain-collection-product-grid.liquidfile.
{%- paginate collection.products by section.settings.products_per_page -%}
{% render 'facets', results: collection, enable_filtering: section.settings.enable_filtering,
filter_type: section.settings.filter_type, enable_sorting: section.settings.enable_sorting, collapse_on_larger_devices: section.settings.collapse_on_larger_devices,
offset : paginate.current_offset,next_link:paginate.next.is_link,page_size:paginate.page_size %}
{%- endpaginate -%}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Anupam Mistry |



