Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello Shopifyer,
I think I posted the question on the wrong board, so I'll try again here.
I would like to include a PDF file or a download link, specific to the product (info sheet on using THIS product) in the confirmation email to the customer.
I have created 2 meta fields in the product for this purpose. One meta field in which I can place the PDF file directly (all file types permitted) and one meta field with the link to the PDF.
I created the definitions in the meta field for the link like this...
custom.link_zum_infoblatt
and for the file as an attachment...
custom.dateianhang_infoblatt
see image below
In the products of the test order/mail, the two meta fields are filled with a file or link.
I use this code for the template...
{% endunless %} </td> </tr> </table> {% assign product_titles = '' %} {% for line_item in line_items %} {% assign product_title = line_item.title | escape %} {% unless product_titles contains product_title %} <p>Vielen Dank für den Kauf von {{ product_title }}! Sie können das Infoblatt für dieses Produkt <a href="{{ line_item.product.metafields.custom.link_zum_infoblatt_url }}" style="color: blue; text-decoration: underline;">hier herunterladen</a>.</p> {% assign product_titles = product_titles | append: product_title | append: ',' %} {% endunless %} {% endfor %}
and get this result...
wow, really nice, but the links are not clickable.
I think it's just a small thing that's causing it to fail and I've tried a few things but can't solve it.
Maybe you can help.
Solved! Go to the solution
This is an accepted solution.
@pfannenwender do you try
line_item.product.metafields.custom.link_zum_infoblatt.url
NOT :
infoblatt_url
@pfannenwender hey, thanks for posting here.
let me test it on sanbox, thanks.
This is an accepted solution.
@pfannenwender do you try
line_item.product.metafields.custom.link_zum_infoblatt.url
NOT :
infoblatt_url
Many Thanks ProtoMan44,
sometimes its a big difference betweet two lines and a simple dot.
As a non-coder and copy/paster you dont know this 😉
Works perfekt, thanks
@pfannenwender not a problem i appreciate that you wrote this code with new idea. 🎉✨
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025