When using the limit property in a for loop it needs to be referenced like so:
{% for item in numbers limit:2 %}
Note the use of :, not =.
Depending on how you're using that code it might also not return 92 products. I'll assume it will return 50 with what I've seen so far.
Thanks, Jason. I changed = to :, but it is still not working. I have included the full page code below.
<div data-section-id="{{ section.id }}" id="collection-new-template">
{% assign number = section.settings.products_per_page %}
{% paginate collection.products by number %}
<div id="collection-description" class="desktop-12 mobile-3">
<h1>{{ collection.title }}</h1>
</div>
<div class="clear"></div>
{% unless section.settings.sidebar %}
<div id="full-width-filter" class="desktop-12 tablet-6 mobile-3">
{% for block in section.blocks %}
{% include 'filters' %}
{% endfor %}
</div>
{% endunless %}
{% if section.settings.sidebar %}
{% include 'collection-sidebar' %}
{% endif %}
<div class="{% if section.settings.sidebar %}desktop-9 tablet-6{% else %}desktop-12 tablet-6{% endif %} mobile-3">
<div id="product-loop">
{% for product in collection.products limit:92 %}
<div class="product-index {% if section.settings.products_per_row == 2 %}desktop-6 tablet-half {% cycle ' first', ' last' %}{% elsif section.settings.products_per_row == 3 %}desktop-4 tablet-2 {% cycle ' first', '', ' last' %}{% elsif section.settings.products_per_row == 4 %}desktop-3 tablet-half {% cycle ' first', '', '', ' last' %}{% endif %} mobile-half" data-alpha="{{ product.title }}" data-price="{{ product.price }}">
{% include 'product-listing' %}
</div>
{% endfor %}
</div>
</div>
{% include 'pagination' %}
{% endpaginate %}
</div>
{% schema %}
{
"name": "Collection Page",
"max_blocks" : 6,
"settings": [
{
"type": "range",
"id": "products_per_row",
"min": 2,
"max": 4,
"step": 1,
"label": "Products per row",
"default": 3
},
{
"type": "range",
"id": "products_per_page",
"min": 2,
"max": 50,
"step": 1,
"label": "Products per page",
"default": 46
},
{
"type": "checkbox",
"id": "sidebar",
"label": "Show sidebar"
}
],
"blocks":[
{
"type":"menu",
"name":"Menu",
"settings":[
{
"type": "link_list",
"id": "side_nav",
"label": "Sidebar menu"
},
{
"type": "text",
"id": "title",
"label": "Menu title",
"default": "Explore"
}
]
},
{
"type":"vendor_list",
"name":"Vendor list",
"limit": 1,
"settings":[
{
"type": "text",
"id": "shop_by_designer_title",
"label": "Vendor list title",
"default": "Shop by Designer"
}
]
},
{
"type":"sort_by",
"name":"Sort by",
"limit": 1,
"settings":[
{
"type": "text",
"id": "sort_by_title",
"label": "Sort by title",
"default": "Sort"
}
]
},
{
"type":"filter",
"name":"Filter",
"limit": 3,
"settings":[
{
"type": "text",
"id": "filter_by_title",
"label": "Filter by title",
"default": "Filter by"
},
{
"type": "textarea",
"id": "filter_by",
"label": "Tag filter"
}
]
}
]
}
{% endschema %}
User | Count |
---|---|
411 | |
202 | |
145 | |
57 | |
43 |