[Feature Request] Data / Metafields for specific options

We have slightly complex product options in our Shopify store. It would be useful to be able to have a product_option.description (that allows for a rich text editor) that could easily be referenced in this object https://shopify.dev/api/liquid/objects/product_option

Would this be useful for anyone else?

1 Like

By the way, if someone is looking for a workaround in the meantime.

I used

{% capture image_loop %}{{product_option.name | remove: " " | downcase | prepend: ‘image_’}}{{forloop.index}}{% endcapture %}

To tie my product_option.name with the forloop.index. (ex. color1, color2, color3)

Then referenced it as so

and added

{
“type”: “image_picker”,
“id”: “image_color1”,
“label”: “Color 1 Image”
},

{
“type”: “image_picker”,
“id”: “image_color2”,
“label”: “Color 2 Image”
},

to my schema. The same could be done with HTML, text, etc. It’s just not very clean

Hi @Arvanitas ,

product_option object only supports these, if you want to use Metafields you need to change the code to variants.

{%- for variant in product.variants -%}
    {{ variant.metafields.my_fields.key }}
{%- endfor -%}

Hope it is clear to you.

1 Like