How to access other properties (like description) in metafields?

GSSIWD
New Member
1 0 0

Hi there, I am editing the product template, and basically I want to get "Description: Value". I have the following setup:

 {% assign tech_specs = product.metafields.techspec %}
            {% for field in tech_specs %}
             <div>
                <strong>{{ field.description }}:</strong> {{ field | last }}
              </div>
             {% endfor %}

 

{{ field.description }} is not giving me anything. Do you guys know how to get description or other properties (author) in metafields?

https://help.shopify.com/en/manual/products/metafields

Thanks.

0 Likes
Dylan_Hunt
Excursionist
32 0 7

Hey, if you're trying to get the product description you;d just change it to product.description. You would not need a metafield for that. If you are trying to use a metafield description you need to identify it first. 

{% assign field = product.metafields.field %}
{{ field.description }}
0 Likes