Add a downloadable PDF to each woocommerce product

[ad_1]

Hello,

I’m looking for a solution in order to create and attach to each product a pdf file that can be downloaded. I don’t want to attach a pdf file to each product manually, i just want something such as when a client clicks the download button a pdf like version of the product page can be downloaded/exported in pdf format.

Thanks in advance

[ad_2]
1 Comment
  1. This will open the ‘print’ window, not sure if it is what you are looking:

    function add_print_button_to_product_page() {
    ?>
    <button id=”print-pdf” class=”button alt”>Print PDF</button>

    <script>
    document.getElementById(‘print-pdf’).addEventListener(‘click’, function() {
    window.print();
    });
    </script>
    <?php
    }
    add_action(‘woocommerce_single_product_summary’, ‘add_print_button_to_product_page’, 35);

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer