Create custom product options with image display on hydrogen #951
-
I now trying to add custom variants. Shopify backend provides very limited options (text only), but I need some variants with numers selection, images displays along with variants. What's the most elegant way doing this? |
Beta Was this translation helpful? Give feedback.
Answered by
juanpprieto
May 31, 2023
Replies: 1 comment 4 replies
-
Are you using hydrogen or liquid? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @LuLue7775
To attach custom data to product variants you could create and link up
metafields
to the Product Variant. My recommendation is to create a metafield which references ametaobject
. The metaobject could then contain all the extra fields you want for a given variant.Here are some screens to get you there:
You could then query the
metafield
and themetaobject
refernce when querying each variant (or Product).Here is some basic example queries for metaobjects to get you started.