Metafield file type not working in notifications templates as in PDP

I want to make link to a PDF file on each product in the order confirmation notification, and this file is stored inside a metafield that accepts all types of files on the product.

The metafield is not working as in a product page.

I’m calling the metafield like:

line.product.metafields.notifications.pdf
line.product.metafields.notifications.pdf.value
line.product.metafields.notifications.pdf.value.url

And give me the same result: gid://shopify/GenericFile/24987315601547

The “metafield_tag” or the “metafield_text” filters are giving the same result, something like:

line.product.metafields.notifications.pdf | metafields_tag
line.product.metafields.notifications.pdf | metafield_text

gid://shopify/GenericFile/24987315601547

and with the “file_url” filter is giving something like:

line.product.metafields.notifications.pdf | file_url

https://cdn.shopify.com/s/files/1/0606/4809/5883/files/?276

also I print the metafield with the “json” filter and the result is:

line.product.metafields.notifications | json

{“pdf”:“gid://shopify/GenericFile/24987315601547”}.

3 Likes