Step 4: Create product metafields

Now we need to create product metafields to link products to the metaobject and define the names for option values (in our example, we define what color each individual product stands for).

To create the metafield that links products to the metaobject, follow the steps below:

  1. In your Shopify admin, go to Settings > Custom data > Products.

  2. Select Add definition.

  3. Insert the Name, for example, "Siblings list".

  4. Hit Select type.

  5. In the dropdown list, find the category "Reference" and select Metaobject.

  6. In the “Reference” section, hit Select metaobject and choose the metaobject created in step 2, for example, "Product siblings".

  7. Make sure the metafield has Storefronts access turned on in the “Options” section.

  8. Save the metafield.

To create the metafield for the option value, follow the steps below:

  1. In your Shopify admin, go to Settings > Custom data > Products.

  2. Select Add definition.

  3. Insert the Name, for example, "Option value label".

  4. Hit Select type.

  5. In the dropdown list, select Single line text.

  6. Make sure the metafield has Storefronts access turned on in the “Options” section.

  7. Save the metafield.

  8. TIP: Copy the Namespace and key of this metafield. You’ll need it in step 6.

Last updated