Link/file in order confirmation Dawn Theme

Solved

Link/file in order confirmation Dawn Theme

pfannenwender
Excursionist
31 0 7

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

pfannenwender_0-1719583230727.png

 

In the products of the test order/mail, the two meta fields are filled with a file or link.

pfannenwender_1-1719583230661.png

 

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...

pfannenwender_2-1719583230796.png

 

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.

Shopify Newbie mit Basic Version
Accepted Solution (1)

ProtoMan44
Shopify Partner
742 60 114

This is an accepted solution.

@pfannenwender  do you try 

line_item.product.metafields.custom.link_zum_infoblatt.url


NOT : 

infoblatt_url


 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

View solution in original post

Replies 4 (4)

ProtoMan44
Shopify Partner
742 60 114

@pfannenwender hey, thanks for posting here.
let me test it on sanbox, thanks.

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!

ProtoMan44
Shopify Partner
742 60 114

This is an accepted solution.

@pfannenwender  do you try 

line_item.product.metafields.custom.link_zum_infoblatt.url


NOT : 

infoblatt_url


 

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!
pfannenwender
Excursionist
31 0 7

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

Shopify Newbie mit Basic Version
ProtoMan44
Shopify Partner
742 60 114

@pfannenwender  not a problem i appreciate that you wrote this code with new idea. 🎉

- A thirsty developer passionate about supporting the community. If you'd like to, you can  

Buy me a Coffee.


- Your Shopify Solution Specialist Get a Quote at

ProtoMan44

 - 

Chat On Whatsapp


Crafting exceptional e-commerce experiences to elevate your online presence. Let's build your success story together!