how to Use Metafiled in Jquery like using .html({{current_variant.metafields.my_fields.pack_size_m2_}}); but not working

Viewed 59

Hi there i want to know how to embbed Shopify Metafield in Jquery like in want to do this

$(selectors.vareintMeta, this.$container)
.html("{{variant.metafields.my_fields.pack_size_m2_}}");

Its Printing {{variant.metafields.my_fields.pack_size_m2_}}

but it should print values in this metafield like 20 or 30 or so on

1 Answers

Your file needs to be .liquid to be able to use liquid code.

Related