show variant price for product option2s

Hello,

I have a code that if my product has option2, it will show them as separate products on the collection page.

Now usually there are multiple sizes of each option2 that are stored in option1. I want the collection page to show the price for the first available variant in option1 with the title of each option2.

So if a product has

option1: {small, medium, large}

option2: {red, blue}

I want to get the price for small/red & small/blue

product.variants.first

returns the first available price for the whole product which in this case is small/red

is there a code that returns the price of all option2s firsts? or any workaround using for loop and split to create an array?

thanks

-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
0 Likes

OR even better if it's possible to get a variant price by using the variant.title

-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
0 Likes