can any one help with using liquid code to display the metafields that shopify generates for products.
since shopify started auto-generating these category smart metafields for products we start using them. However i need to add some into a custom code snippet from my store theme.
usually for the metafield single text line (multiple lines) metafields i created i use:-
{% if product.metafields.custom.flavour != blank %}
<p>Flavour:<br>
{{ product.metafields.custom.flavour.value | join:', ' }}
</p>
{% endif %}
this works great. However the new shopify metafield seems to be metaobject attribute and i cannot seem to use the liquid code above. The metafield in question is a number of choices so and its id is “shopify.dietary-preferences”, but the meta object id is “shopify–dietary-preferences” which do i need to use and what would be the correct use similiar to my ‘if statements’?