Summary
Using metafields you can display custom data within your product table.
โ
Setting up your metafields
Displaying Product and Variant metafields within your product table:
Within your theme editor navigate to 'Theme settings'
Click 'Product cards'
Scroll down to 'Table details'
Enter the designated metafield you would like to display within your table
Displaying custom data using metafields
Use the Metafield block to display custom data. This can be used to compare different properties or values of products in a side-by-side view. To do this follow the below steps
Navigate to your Shopify admin and select Settings > Custom data
Within the Metafield definitions click 'Products' and select 'Add definition'
For this example we can use 'Weight'. Make sure the Namespace and key are labeled accordingly. For this example I chose: 'custom.weight'. Set the type to 'Multi-line text'.
Within the Metaobject definitions click 'Add definition'. Set a name according to your metafield definition. For 'Type' select multi-line text and chose a name. For this example my metaobject key will be: 'weight.custom'.
Navigate back to a product page within your Shopify admin, scroll to the bottom of the page. You should now see your 'Product metafields'. You can set the custom data within those fields.
To display your custom data within your theme editor select the 'Product comparison' section > Add block > and select 'Metafield'.
To display your custom data within your theme editor select the 'Product comparison' section > Add block > and select 'Metafield'.
Creating your metafield data
For more information see the attached screen shots below:
Navigating to custom data
Adding a metafield definition
Adding a metaobject definition
โ