Add swatches to product option through custom fields

Hello, I’d like to add color swatches to my product option.

To do so I’ve created a metafields (type: color picker) and I was trying to add it in the code under the ‘variant_picker’ of product section.

I followed this video tutorial but unfortunately that method works only when product don’t have multiple options.

In my case I have 2 option, one with 5 values and the other with 3.

Is there a way to target only particular option when looping with ‘{{ product.variants[forloop.index0].metafields.color.value }}’ ?

I’m developing on Dawn theme 4.0

Thank you!

1 Like

@archimed May this help you. Click Here.

Did you figure this out?

I am doing something similar. using Metafields. But I am not able to locate the code of the “color picker” since I am using a different theme. Do you know if there is another name for this? Instead of “Color picker”? Thank you

unfortunately I still haven’t figured out how to solve this

1 Like

this is through js

https://www.youtube.com/watch?v=q5OHBsm1Nig

it was really helpful

1 Like

thank you this was very helpful.