I have 3 collections which are best selling helmets (The most popular items in Helmets) , helmet closeouts and helmets (All products) on one collection page called Helmets. So I want to show pagination for best selling helmets and helmet closeout by 4 while pagination for helmets by 12.
How can I do that?
Url: https://durianbikers.myshopify.com/collections/helmets
Thank you.
{% if collection.handle == 'helmets' %}
{% paginate collection.products by 4 %}
{% render 'breadcrumbs' %}
#
{{ collection.title }}
{% if current_tags %}
– {% assign title_tags = current_tags | join: ', ' %}
{{ title_tags }}
{% endif %}
# The most popular items in Helmets
{% for product in collections['best-selling-helmets'].products %}
{% include 'best-helmet-card', product: product %}
{% else %}
{% if shop.products_count == 0 %}
{% assign collection_index = 1 %}
{% for i in (1..10) %}
{% case i %}
{% when 7 %}
{% assign collection_index = 1 %}
{% when 8 %}
{% assign collection_index = 2 %}
{% when 9 %}
{% assign collection_index = 3 %}
{% when 10 %}
{% assign collection_index = 4 %}
{% endcase %}
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
{{ 'homepage.onboarding.product_title' | t }}
$19.99
{% assign view_string_length = 'products.product.view' | t | size %}
{{ 'products.product.view' | t }}
{% assign collection_index = collection_index | plus: 1 %}
{% endfor %}
{% else %}
{% comment %}
If collection exists but is empty, display message
{% endcomment %}
{{ 'collections.general.no_matches' | t }}
{% endif %}
{% endfor %}
# Helmet Closeouts
{% for product in collections["helmet-closeouts"].products %}
{% include 'product-card', product: product %}
{% else %}
{% if shop.products_count == 0 %}
{% assign collection_index = 1 %}
{% for i in (1..10) %}
{% case i %}
{% when 7 %}
{% assign collection_index = 1 %}
{% when 8 %}
{% assign collection_index = 2 %}
{% when 9 %}
{% assign collection_index = 3 %}
{% when 10 %}
{% assign collection_index = 4 %}
{% endcase %}
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
{{ 'homepage.onboarding.product_title' | t }}
$19.99
{% assign view_string_length = 'products.product.view' | t | size %}
{{ 'products.product.view' | t }}
{% assign collection_index = collection_index | plus: 1 %}
{% endfor %}
{% else %}
{% comment %}
If collection exists but is empty, display message
{% endcomment %}
{{ 'collections.general.no_matches' | t }}
{% endif %}
{% endfor %}
{% endpaginate %}
{% paginate collection.products by 12 %}
{% for product in collection.products %}
{% include 'product-card', product: product %}
{% else %}
{% comment %}
Add default products to help with onboarding for collections/all only.
The onboarding styles and products are only loaded if the
store has no products.
{% endcomment %}
{% if shop.products_count == 0 %}
{% assign collection_index = 1 %}
{% for i in (1..10) %}
{% case i %}
{% when 7 %}
{% assign collection_index = 1 %}
{% when 8 %}
{% assign collection_index = 2 %}
{% when 9 %}
{% assign collection_index = 3 %}
{% when 10 %}
{% assign collection_index = 4 %}
{% endcase %}
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
{{ 'homepage.onboarding.product_title' | t }}
$19.99
{% assign view_string_length = 'products.product.view' | t | size %}
{{ 'products.product.view' | t }}
{% assign collection_index = collection_index | plus: 1 %}
{% endfor %}
{% else %}
{% comment %}
If collection exists but is empty, display message
{% endcomment %}
{{ 'collections.general.no_matches' | t }}
{% endif %}
{% endfor %}
{% if paginate.pages > 1 %}
{{ paginate | default_pagination | replace: '« Previous', '←' | replace: 'Next »', '→' }}
{% endif %}
{% endpaginate %}
{% else %}
{% paginate collection.products by 20 %}
{% render 'breadcrumbs' %}
{% for product in collection.products %}
{% include 'product-card', product: product %}
{% else %}
{% comment %}
Add default products to help with onboarding for collections/all only.
The onboarding styles and products are only loaded if the
store has no products.
{% endcomment %}
{% if shop.products_count == 0 %}
{% assign collection_index = 1 %}
{% for i in (1..10) %}
{% case i %}
{% when 7 %}
{% assign collection_index = 1 %}
{% when 8 %}
{% assign collection_index = 2 %}
{% when 9 %}
{% assign collection_index = 3 %}
{% when 10 %}
{% assign collection_index = 4 %}
{% endcase %}
{% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
{{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
{{ 'homepage.onboarding.product_title' | t }}
$19.99
{% assign view_string_length = 'products.product.view' | t | size %}
{{ 'products.product.view' | t }}
{% assign collection_index = collection_index | plus: 1 %}
{% endfor %}
{% else %}
{% comment %}
If collection exists but is empty, display message
{% endcomment %}
{{ 'collections.general.no_matches' | t }}
{% endif %}
{% endfor %}
{% if paginate.pages > 1 %}
{{ paginate | default_pagination | replace: '« Previous', '←' | replace: 'Next »', '→' }}
{% endif %}
{% endpaginate %}
{% endif %}