Turning a button into a link that downloads little bits of software & PDF's?

Topic summary

Goal: Convert a product-page “Download” button into a direct download link, with a different file URL per product. The page is a custom template for free downloads with add-to-cart and price hidden.

Approach discussed:

  • Store the file URL in a product metafield so each product can have its own link.
  • In the custom Liquid section/template, render the button as an anchor tag and set its href to the metafield value (i.e., use the metafield in the href attribute).

Context: A temporary orange download link is in place while the final setup is figured out. The intent is to support PDFs and small software downloads.

Status/outcome: A clear path was suggested (metafield-driven href). No confirmation of implementation or further technical details yet; discussion appears open.

Summarized with AI on December 13. AI used: gpt-5.

Hey,

https://www.keylibrary.co.uk/products/code-collector

I am looking for the best solution to change the ‘Download’ button into a link that will automatically download whatever I set it to. I would like to create several products like this, so I’d need the option to apply different URL’s each time. What would be the easiest way? I created a new template just for this, added the button as a custom liquid, then I hid add to cart, price, etc. This section is just for FREE downloads for all customers.

I was thinking like a metafield that I can place the link into each time that would link to the button, but not sure if this would work, or how?

I put a temporary download link in orange just whilst I figure this out.

yes this can be done by storing the link in metafiled
you can use that metafield in href attriute

DOWNLOAD