Customize How Many Products Appear on a Category Page
On this page
If you want to increase or decrease the max number of products displayed on category pages, you can do this by editing your theme. By default, our base theme will display a maximum of 12 products per page.
Increasing the number of product cards that render on a page will slow down the page load speed. We recommend setting a number not higher than 25.
Modify Your Theme
- Check if your theme already has a template with a key of snippets/products/results (look for snippets/products/wrapper if you are using v18 or below)
- If so, skip to step 6 and just modify your template using the code snippets shown below.
- Create a new template in your theme.
- Give it this key: snippets/products/results
- Grab the template code for your liquid version from our Base Theme.
- Find the correct version for your website
- Locate the snippets/products/results template
- Copy the code
- Paste the code in the content field of your new template
- Edit the code to include the following snippets:
liquid
{% assign products_per_page = 24 %}
liquid
{% paginate products by products_per_page %}
By default, the number of products displayed per page is determined by the current_search.per_page attribute. To override this, define a new variable with the desired number of products per page.
Your final code would look something like this:
```liquid {% default products: current_search.results.products %} {% default allow_comparisons: false %} {% assign products_per_page = 24 %}
{%- if current_search.count > 0 %} {% paginate products by products_per_page %}
{% for product in products %}
{%- cache "product", items: [product, current_store, current_customer] -%}
{%- render "products/card", product: product, allow_comparisons: allow_comparisons %}
{%- endcache -%}
{% endfor %}
{% render 'shared/pagination-nav', paginate: paginate %} {% endpaginate %}
{%- if allow_comparisons and theme_variables[“products.comparisons”] == true %} {% render “products/comparison_banner” %} {% render “products/screen” %} {%- endif %} {% else %}
{{ "search.products.index.no_results" | t }}
{% endif %} ```