Ecommerce Shopify WordPress Discussion

Shopify page metafield of the list type only returning 50 items

I've got a metafield assigned to pages in my theme and it's the File (List) type. There are 84 items in that list, but Shopify is only returning 50. I figure there is some sort of default limit, but can't find any documentation on how to return all items or at least paginate through them. A simple version of the Liquid I'm using in the template that returns 50 of the 84 items is {% assign file = page.metafields.custom.collection_images.value %} {% for field in file %} <p> {{ field }} </p> {% endfor %} If I try and count the items in the list using {{file.count}}, it actually returns the count as 84, like so {% assign file = page.metafields.custom.collection_images.value %} <p>{{ file.count }}</p> {% for field in file %} <p> {{ field }} </p> {% endfor %} Is there a way to get all 84 items to render in the for loop?
That a look at using the paginate aspect of resources. Any time you wrap a resource with a default of 50 items in paginate you should be able to uncork the pages of items that are not returned by default. If it does not work for metafields, then try a different technique I guess. For example to store 84 things in a list, you can use JSON as a replacement? Not ideal but might work, as it all depends on your use case for the list.

February 13, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.