• Resolved mvlaspld

    (@mvlaspld)


    In every user account I want an instruction manual by default in the download folder of the My Account Page.

    There is a snippet to make this happen and placed it in the functions.php of the template, and it works

    add_filter( 'woocommerce_customer_get_downloadable_products', 'woo_free_introduction', 9999, 1 );
     
    function woo_free_introduction( $downloads ) {
       $downloads[] = array(
          'product_name' => 'Instruction Manual',
          'download_name' => 'Download',
          'download_url' => '/Instruction.pdf',
       );
       return $downloads;
    }

    My issue, or where I need some help with, is that the downloaded item (in this case a PDF, opens in the same window as the website. I want that the target is _blank when opening / downloading the PDF.

    I tried to adjust the script but constants get error’s, what is the best way to add the target to the download url so it opens in new window?

    Thank you in advantage!

    • This topic was modified 2 years, 7 months ago by mvlaspld.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Default Item Download @ My Account Page’ is closed to new replies.