I am trying to create a custom page that shows inventory for our wholesalers for all products and is paginated. For whatever reason, the products in the for loop do not paginate. The pagination navigation shows all of the pages for our products but when clicked it still shows the same first 25 products no matter what page it is on.
{%- assign featured_collection = section.settings.collection -%}
{% paginate featured_collection.products by 25 %}
# {{section.settings.heading}}
{{ paginate | default_pagination: next: '>', previous: '<' }}
{% for product in featured_collection.products %}
{% assign total_inventory = 0 %}
{% assign sku_length = product.first_available_variant.sku | size | minus: 1%}
{% endfor %}
| Collection | Item Name | Mockup | Design Code / Season | Wholesale Price | Available Sizes | Total Available |
| - | - | - | - | - | - | - |
| {{product.collections[1].title}} | {{product.title}} | | {{product.first_available_variant.sku | slice: 0,sku_length }} | {{product.price | times: 0.5 | money }} | <br> {% for variant in product.variants %}<br> {{variant.option1}}: {{variant.inventory_quantity}}<br><br> {% assign total_inventory = total_inventory | plus: variant.inventory_quantity %}<br> {% endfor %}<br> | {{total_inventory}} |
{{ paginate | default_pagination: next: '>', previous: '<' }}
{% endpaginate %}
{% style %}
td img {
max-height: 300px;
}
{% endstyle %}
{% schema %}
{
"name": "Inventory Table",
"settings": [
{
"type": "text",
"id": "heading",
"label": "Heading"
},
{
"type": "collection",
"id": "collection",
"label": "Collection"
}
],
"presets": [
{
"name": "Inventory Table",
"category": "Store information"
}
]
}
{% endschema %}