Differentiate product options from Storefront API? #1234
Unanswered
JeromeTrottier
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently according to the documentation of the ProductOption, we can only fetch an id (which would be ideal, but is only unique to each product and not all products), the name of the option and the values.
https://shopify.dev/docs/api/storefront/2023-07/objects/ProductOption#fields
Is there any way to know which option is which if we have more than 1 of them?
I'm trying to display 2 different components based on if the option is for the size or the color of a product, but the current fields don't allow me to do this. Is there anyway to add a readable id to them (open to other solutions too)? I could use the name except my site is in multiple languages, so it would be kind of cursed to use that.
Beta Was this translation helpful? Give feedback.
All reactions