Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello there,
I've something like that in a section:
{% paginate section.settings.selected_collection.products by 1 %}
{%- for product in section.settings.selected_collection.products -%}
{% render 'product-card-A', product: product %}
{%- endfor -%} {
% render 'pagination-A', pagination: paginate %}
{% endpaginate %}
I'm working with a 4 different products as dummy content and this code results in 4 pages (which is fine, 1x4), but displays all the 4 products in each page. The pagination nav works fine.
I'm missing something?
Ok, I'm not 100% sure, but it seems that doesn't work because collection is not a global object. I solved it this way: Instead of iterating the products directly from this array:
section.settings.selected_collection.products
I used the global object collections:
{%- assign current_products = collections[section.settings.selected_collection] -%}
{% paginate current_products.products by 1 %}
{%- for product in current_products.products -%}
{% render 'st-product-card-A1', product: product %}
{%- endfor -%}
{% render 'st-pagination-A', pagination: paginate %}
{% endpaginate %}
(section.settings.selected_collection is a setting type collection, and it returns the collection's handle)
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025