variant.metafields.custom.var_onsale not recognised on Product page?

variant.metafields.custom.var_onsale not recognised on Product page?

ScinteraShopy
Shopify Partner
43 5 2

I have custom metafields created for Products and Variants.

When I attempt to use (var_onsale is Boolean)

variant.metafields.custom.var_onsale

in a Liquid block on the Product page (with variants) it seems to be ignored. i.e.

{% if variant.metafields.custom.var_onsale %}
<p>variant.metafields.custom.var_saleprice</p>
{% endif %}

however if I display the product.metafields.custom.onsale it works.

 

The Product page/Product I am editing has variants.

Does anyone have suggestions as to what I am doing wrong please? Thanks in advance.

 

 

Replies 0 (0)