-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variant metafield type List of files return string #1643
Comments
I also noticed a similar bug to access metafields list by index: For instance, this works as expected for
But it doesn't work for product_reference in list, unless for the
I tried multiple array filters such as |
@MaxDesignFR
|
|
@akairo0902 Interesting filter, I wonder why it's undocumented. I do Shopify everyday so it's a shame I find out like that. It also does not solve the problem I highlighted. It seems metafields Objects (products, collections, ...) in a list are not accessible by index, still probably a bug: Say a product metafield, with product type (list of values) : I did some testing and the filter |
oh really? {{ current_variant.metafields.custom.hero_images.value | json_string }} |
I've also struggled the same problem. after I got |
The |
ah I see. yeah I also tried to use "value[0]" but it didn't work. it won be the one you are looking for but I also could get what I want without
|
If I used
{{ current_variant.metafields.custom.hero_images | json }}
result
{"error":"json not allowed for this object"}
If I used
{{ current_variant.metafields.custom.hero_images }}
result
["gid://shopify/MediaImage/31079273267451","gid://shopify/MediaImage/31079273300219"]
If I used
result
"[\"gid:\/\/shopify\/MediaImage\/31079273267451\""
If I used
{{ current_variant.metafields.custom.hero_images.value | json }}
result
["\/\/cdn.shopify.com\/s\/files\/1\/0200\/6358\/4356\/files\/Black_-_Desktop.jpg?v=1666336384","\/\/cdn.shopify.com\/s\/files\/1\/0200\/6358\/4356\/files\/Black_-_Mobile.jpg?v=1666336384"]
But if I use
result -
null
How to transform this list that looks like an array to an object?
Or how I can get access for index in list files?
The text was updated successfully, but these errors were encountered: