Hi,
I have a link to PDF file in the customer order backend, how to show it as download link in the customer order frontend page?
Also can I transfer the PDF pages to individual images, then add both the PDF files + the images to the order frontend page?
I am using Craft theme
I am not sure what is the your_namespace.your_key
Hello @CreativeMind202 ,
You can try to follow these steps:
Go to Online Store → Themes → Actions → Edit code
Go to Sections → order.liquid file
Modify the code to display a download link for the PDF file. Here’s an example:
{% if order.pdf_file_url %}
Download PDF
{% endif %}
Save changes
Hope this can help. Let us know if you need any further support.
Ali Reviews team.
Unfortunately, this didn’t work!
Hello @CreativeMind202 ,
I’m sorry for that. Here is another solution you can try to follow to display a PDF file as a download link on the customer order frontend page:
- Go to Online Store → Themes → Actions → Edit code
- Go to Templates → order.liquid
- Search for the section where the customer order details are displayed, typically within a {% for line_item in order.line_items %} loop. It might look something like this:
{% for line_item in order.line_items %}
{% endfor %}
- Add the following code to create the download link for the PDF file:
{% if line_item.properties.pdf_file %}
Download PDF
{% endif %}
Hope this can work. Let us know if you can make it or not.
Ali Reviews team.
1 Like
Thank you very much, your solution gave me the hint on how to solve it!
Your solution is not wrong and I will accept as solution, but instead of the .pdf_file the variable assigned by the app developer should be used.