javascriptajaxshopifyshopify-template

show product title in shopify product-template


when I print this

{{ product.metafields.custom.add_product_to_show }}

I got this gid://shopify/Product/8019965837629

how can I show the above product title and description?

This is not working {{ product.metafields.custom.add_product_to_show.title }}


Solution

  • You need to fix your Liquid Syntax. Metafields are a key:value store, namespaced. So in your case:

    namespace is: custom  (wow, clever!!)
    key is: add_product_to_show
    

    So what you really want, is the value now, and that you can get as:

    {{ product.metafields.custom.add_product_to_show.value }}