Get product description with metafield in shopify
Solution:
There should not be.value
inproduct.metafields.custom.us_product.value.description
us_product
is the key
product.metafields.custom.us_product
is the value
Plus, from your line, what is.description
? You are basically getting the "description" of a string stored in metafield..description
does not exist.
Below is how you get a product with metafields. The product handle is stored in the metafields.
put the name in bracket to include space and special characters.
There is a 64 character limit on metafield key;
{% assign usProductHandle = product.metafields.custom["us_product"]%}
{% assign usProductDescription = all_products[productHandle].description %}
{{usProductDescription}}
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.