All things Shopify and commerce
Hi guys, I'm facing a problem, please let me know if you've any solution for this. I've created a metaobject with the two values : one is list of files and second list of single line text, and attached it in a product metafield. now when I want to address those values in liquid as currently I'm easily able to address fields with single value but when it comes to multiple values(list of values) it's creating a problem. It's printing nothing when I'm addressing the multiple values field. {% assign prdata = product.metafields.custom.colourvariants.value %} {% assign prdataImg = product.metafields.custom.colourvariants.value.img %} <img src="{{ prdata.secimg | image_url }}" width="30" height="30"> {{ prdataImg }} {{ prdata.secimg }} here is the reference code, in the above code prdataImg contains list of files which is not printing anything and below you can see {{ prdata.secimg }} is a single value field and its visible {{ prdata }} is returning MetaObjectDrop I tried to take ChatGPT help, it also didn't worked out.
Hey @Kushagra0602
Please try this.
{% assign prdata = product.metafields.custom.colourvariants.value %}
{% for item in prdata %}
<img src="{{ item.img | image_url }}" width="30" height="30">
{{ item.text }}
{% endfor %}
Didn't work, .img is a list of images and that's where I'm stuck, it's working prefectly with the single value. I tried to loop it also.
Sorry to know that it not worked,
{% assign prdata = product.metafields.custom.colourvariants.value | json %}
{% for item in prdata %}
<img src="{{ item.img | image_url }}" width="30" height="30">
{{ item.text }}
{% endfor %}
In this tried JSON
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024