Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I have a clothing store and I want to hide ‘size chart’ field on certain product page. I’m using Dawn theme.
Solved! Go to the solution
This is an accepted solution.
If it is a predefined block that uses a metafield definitions as a dynamic source then you will want to create an alternate template to use on the products that have no style guide.
If you are using a a custom-liquid block|section simply use a liquid if tag to conditionally check if the metafield exists {% if product.metafields.information.size_guide %}.
Or is blank {% if product.metafields.information.size_guide != blank %}.
https://shopify.dev/api/liquid/basics#truthy-and-falsy-example
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
This is an accepted solution.
If it is a predefined block that uses a metafield definitions as a dynamic source then you will want to create an alternate template to use on the products that have no style guide.
If you are using a a custom-liquid block|section simply use a liquid if tag to conditionally check if the metafield exists {% if product.metafields.information.size_guide %}.
Or is blank {% if product.metafields.information.size_guide != blank %}.
https://shopify.dev/api/liquid/basics#truthy-and-falsy-example
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Yes that worked. Thanks for your help!
Here is the best way I used to solve this problem:
Step 1: Add "Custom liquid/Custom HTML" block instead of Text block.
Step 2: Go to Dashboard -> Settings -> Custom data -> Products
Step 3: See all the keys generated to access your metafields example: "product.metafields.custom.gemstone_size"
Step 4: Go to Dashboard -> Customize
Step 5: Go to product or any other page where you are displaying metafields (in my case I need on product page)
Step 6: For individual metafields to display, just add "Custom liquid" block and put the conditions like this:
{%- if product.metafields.custom.gemstone_size != blank -%}
<strong>Gemstone size (cm):</strong> {{ product.metafields.custom.gemstone_size }}
{%- endif -%}
In your case the keys for displaying metafields will be different. For each metafield to display you need as many "Custom liquid" blocks and need to put conditions accordingly.
Hope! I answered the question.
Thanks
This is very heplful, thank you!
Learn 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, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025