Liquid, JavaScript, themes, sales channels
Hello,
I use the Minimal theme and recently i've been working with a friend making this page inside my clothing store website. Its a "coupon" type page. We are struggling figuring out how to make a link a direct download for anyone who click it.
For anyone that is kind to help me please you have to login before you can see the link. You just have to click "obtener descuento" and then "descargar cupon". This last one is the one we want to be a direct download link instead of another tab.
https://mehperu.com/pages/compraperu#
Thank you so much!
Having to create an account and login to see the page will likely discourage people from helping.
In either case the first thing to do is upload the PDF to your site. After uploading you can get the URL of the asset (see the documentation I just linked) to.
Is the page you want the link to appear on a Page or a part of product Liquid template?
If a Page, see the section here on adding a link.
If it's in Liquid you'll have to add the following to the appropriate template:
{{ 'Download Coupon' | link_to: 'https://cdn.shopify.com/s/files/path-to-your.pdf' }}
Or if the PDF's contents can change often but file's name remains the same:
{% assign pdf = 'size-chart.pdf' | file_url %} {{ 'Download Coupon' | link_to: pdf }}
Thanks for the instructions and links - easy to follow !
Hi all,
Could you please let me know how to create a download link that customer can directly download the file when they click on the link rather than opening inside the browser.
For example as below image, customer clicks on the "size guide", then the PDF file can be downloaded directly, rather than opening a new browswer, and click download button inside.
Thank you.
ps, here is my store: www,limkoocycling,com in debut shopify.
the only way to force the download would be to have it in a ZIP folder - shopify serves all its images and files from their CDN which disqualifies it from instant download markup. You would need to zip the file/files into a .zip format and then link to that in your code.
* Chrome 65+ and Firefox only support same-origin download links.
Hi,
This is doable in Shopify. Please check the video for more info.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024