Shopify/storefront-api-examples

Displaying variant titles

JackMcCalley opened this issue · 0 comments

I have my product displayed, and the ability to change variants, however I can't seem to figure out how to display what the title of the variant is. Any help would be appreciated.

edit: Figured it out, added this expression in the variantSelectors map in the Product.js file:
{variant.attrs.selectedOptions[i++].attrs.name.toString()}

And of course I added let i = 0; on the first line of the render on line 49