Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Add swatches to product option through custom fields

Add swatches to product option through custom fields

archimed
Tourist
11 0 4

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!

 

Replies 5 (5)

DelightCart
Shopify Partner
1264 83 157

@archimed May this help you. Click Here.

Delight Cart - It's time to turn your visitors into loyal shoppers! 

Delight Loyalty - Increase repeat sales quickly and build lifelong customers loyalty.

FindingPlumbing
Excursionist
14 0 2

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

SV
archimed
Tourist
11 0 4

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

BrandBuilding88
Excursionist
29 2 6

this is through js 

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

it was really helpful 

FindingPlumbing
Excursionist
14 0 2

thank you this was very helpful.

SV