Shopify themes, liquid, logos, and UX
I am trying to display the metafield with the namespace and key: custom.model_size on my product page on several different places. However everywhere i try to implement it by using several different codes like:
{% if product.metafields.custom.model_size %}
<div class="model-size">
<p>{{ product.metafields.custom.model_size }}</p>
</div>
{%- endif -%}
=it shows something like the json structure: {"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Model: 172cm/5'7.7\" and wears size S"}]}]}
Solved! Go to the solution
This is an accepted solution.
Hey @Issyeissue
Replace your code with the code below, it will be good to go then
{% if product.metafields.custom.model_size %}
<div class="model-size">
<p>{{ product.metafields.custom.model_size | metafield_tag }}</p>
</div>
{%- endif -%}
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
This is an accepted solution.
Hey @Issyeissue
Replace your code with the code below, it will be good to go then
{% if product.metafields.custom.model_size %}
<div class="model-size">
<p>{{ product.metafields.custom.model_size | metafield_tag }}</p>
</div>
{%- endif -%}
If I managed to help you then, don't forget to Like it and Mark it as Solution!
Best Regards,
Moeed
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025