Does anyone have clues as to why this is happening? Does Shopify change these low level functions without warning, or do they fail intermittently? I’d love to have a good explanation for my client who’s upset that his theme broke.
It happened again! I’m going totally crazy! I can see the array has multiple items by console logging it, but when using the filter SIZE or looping through the items it prints ZERO or acts as if it has ZERO items to loop through!
First, thank you deeply, it worked and I thought I was going crazy.
Second, isn’t it crazy that this has been reported in 2021, and only now a guardian angel like yourself had to come to the rescue with a property that Shopify didn’t even bother to document in their API? How come the APIs list ‘size’, which doesn’t work apparently, but doesn’t mention ‘count’, which apparently does work?
This is the ‘size’ documentation: https://shopify.dev/docs/api/liquid/filters/size
I signed up for an account here just to thank you, someone give this person a medal!! I wasted an entire day trying to figure out why I can’t get either of these to work.
.size
or
MetaobjectListDrop | size
No matter what I did as per the documentation and its “AI Assistant” I kept on getting 0. Why is this not mentioned in https://shopify.dev/docs/api/liquid?