Question

I have a tangible product (non-virtual) that will be shipped on purchase. however i want to have allow users to download a sample pdf on the product page itself before they add to cart.

Currently, i see that the download links are only available after checkout etc. And i know you can paste the link into the product description. but this all needs to be done manually.

Instead, how do i use the file upload mechanism already in place on WooCommerce on individual products, and display something like "Download File" that links to the file uploaded earlier on the 'Edit Product' page?

do i need to work with something like advanced-custom-fields etc?

Was it helpful?

Solution

I managed to solve it myself by using the plugin, "Advanced Custom Fields".

added a custom file upload field with "product_hires" id. then got the link to show on the product page by having this in template files for the product page.

<p>
<a href="<?php the_field('product_hires'); ?>">Download Hi-res</a>
</p>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top