Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
{% assign has_drawing = false %}
{% for variant in product.variants %}
{% if variant.metafields.custom.product_finish != blank %}
{% assign has_drawing = true %}
{% endif %}
{% endfor %}
{% if has_drawing %}
<!--HTML to display custom metafiled goes here-->
{% endif %}
So, I've used this same method for multiple custom metafields, and they all appear to be working as expected, except for this particular metafield (and only in certain circumstances)
You can see in Item 1 that the only the one metafield with relevant data is displayed
However on Item 2, the Technical Drawing section is displayed (despite the metafield being blank)
I have checked in the products section of the dashboard and confirmed that there are no blank spaces or other any other characters which may be tricking the liquid conditional logic to flip has_drawing over to true....I'm just sort of stumped what could be causing it.
Any input would be greatly appreciated. Thanks!
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025