Hi all!
I’m trying to get something like the following to work:
{% for t in product.tags %}
{% if t contains 'sizechart' %}
{{ shop.metafields.custom_fields["{{ t }}"] }}
{% endif %}
{% endfor %}
I am using a custom metafields app and the tag syntax is this: {{ shop.metafields.custom_fields[“FIELD-HANDLE”] }}
So I’m trying to make it possible to create tags within a product (say it’s sizechart_dress) that match the FIELD-HANDLE that goes into the custom metafields tag. That way it can automatically pull that tag and just automatically place it inside the metafields tag and pull the correct information.
I read that I could assign a variable such as:
{% assign sizeChartStyle = t %}
and then call that variable within a tag by using instead of {{ }} but that also did not work - and maybe that is because the metafields tag already has as part of its syntax?
There must still be a way to pull that product tag into the metafields tag!
Thank you for any help!