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

Shopify Partner
26 1 2

I have custom metafields created for Products and Variants.

When I attempt to use (var_onsale is Boolean)


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

{% if variant.metafields.custom.var_onsale %}
{% 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)