How do I check metafield values in liquid for app visibility?

How do I check metafield values in liquid for app visibility?

CryptoMassive
Shopify Partner
1 0 0

Hi, I am trying to build an app for shopify. I am using typescript, nodejs, react for dashboard and also theme app extension for storefront.

The main problem is that I have one line text meta field and there are two options true or false. I am trying to check this meta field value in my embed app block, If the value is true then the app block should be shown, If not then it should not be shown. I was running this fine before when I was using product metafield.

{% if product.metafields.custom.check == "true" %} this was working

but right now

{% if variant.metafields.custom.check == "true" %}
When I try this, I cannot run it in any way, my goal is that users can edit whether the app-block element appears or not, that is, it should appear in x variant or not in y variant.

 

Replies 0 (0)