Metafield-linked product options
Learn about how to link metafields to product options in the new product model.
Why we've made these changes
Anchor link to section titled "Why we've made these changes"The updated Shopify product taxonomy is an open-source comprehensive, global standard for product classification. It's a universal language that empowers merchants to categorize their products. Spanning 22 essential verticals, our taxonomy encompasses categories, attributes, and values, all thoughtfully integrated within Shopify and numerous marketplaces.
By using standard metaobjects to model each attribute's values (as metaobject entries), we ensure reusability and shop-specific customization. To connect metaobjects to any resource in Shopify, we use metafields (of type metaobject reference). Then, we introduced the ability to connect these metaobjects such that merchants can create variants for each attribute value.
Linking product options to metafields
Anchor link to section titled "Linking product options to metafields"In the new product model, variants are still a byproduct of the product’s options, representing the individual SKUs derived from the various attributes that define the product. With the new Shopify Product Taxonomy, a product's category now includes standard metafield references for each associated attribute. To use these metafield references to create variants, they must be connected to options.
For example, a shoe might be categorized as Apparel & Accessories > Shoes
, which comes with the following pre-packaged attributes (metafields):
- Age group
- Closure type
- Color
- Footwear material
- Occasion style
- Pattern
- Shoe fit
- Shoe size
- Target gender
- Toe style
These metafields can be linked to options with the following mutations:
For example, to use productCreate
to create a new shoe with options for Color
and Shoe size
you could call the following mutation: