Hello to all, welcome to therichpost.com. In this post, I will tell you, How to add download pdf link in woocommerce single product page?

I am showing download pdf link on single product page with help of woocommerce hook.
Here is the woocommerce hook and please add carefully into your theme’s functions.php file:
add_action('woocommerce_before_single_product_summary','download_pdf',11); function download_pdf() { echo "<a href='add_your_pdf_link' target='_blank'>Download PDF</a>"; }
If you have any query regarding this then please do comment below.
Jassa
Thank you
Comments
4 responses to “How to add download pdf link in woocommerce single product page?”
hi i used your code in themes functions.php but it is not showing download pdf button in product details page,
do i need to modify some others files too ?
Try this:
add_action( ‘woocommerce_before_single_product_summary’, ‘download_pdf’, 10 );
function download_pdf()
{
return “Download PDF“;
}
Is there a way of turning this into a shortcode so that you can enter it into a template?
yes we can.