I am using metafields editor to display some additional information in the Shopify store. I need help in displaying the output of the below product variant metafields in Shopify product page. What code do I need to add into the product.liquid file? Do I also need to have a JavaScript snippet?
Product description metafield for product variants:
namespace: variantdescription
key: Product Description
value: This is product description for variant A
value_type: string
Product delivery metafield for product variants:
namespace: variantdelivery
key: Delivery Time
value: This is delivery time for variant A
value_type: string
2
Answers
You can get the metafield value with this code:
The code that you have to use for product description will be something like this:
It will be like this for the Delivery time:
Here is the information about how to use metafields in liquid.
https://help.shopify.com/en/themes/liquid/objects/metafield
JavaScript is not needed.
Get Description of current variant:
Likewise for product delivery