• Hello,

    We sell digital goods on our website. We use WooCommerce. I am hoping that someone can provide me with some assistance. I am trying to disable the download links which are generated and sent to customers upon order completion.

    I do not want the customer to be able to download the digital products from links in the emails they are sent. I want them to only be able to access them through the download tab on the My Account screen in WooCommerce.

    Can you please tell me what line of code I would need to put into my functions.php file in order to prevent the emails from including download links upon order completion?

    Thanks!

    • This topic was modified 8 years, 2 months ago by Nick.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I don’t think there is a suitable hook so you will need to make a custom email template.

    As a test, go to:
    plugins/woocommerce/templates/emails/email_order_details.php
    and comment out line 55. // $order->display_item_downloads( $item );

    If this works, unfortunately the change will be overwritten by the next update.

    To avoid this, you will need to make a child theme and copy the file to:
    wp-content/themes/my-child-theme-name/woocommerce/emails/email_order_details.php

    If your theme has a template override for this email, start with that.

    I’m assuming your emails are html. Plain emails come from a different template.

    The customisation may still occasionally need to be repeated if the original template is updated.

    Thread Starter Nick

    (@pilotnick)

    I was not able to find that in email_order_details.php. I was however able to find that in email-order-items.php. I commented it out and it didn’t remove the links.

    Not sure why.

    Sorry, yes email_order_items.php.

    Did you check if your theme has a template override at:
    wp-content/themes/my-theme-name/woocommerce/emails/email_order_items.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disable Download Links on WooCommerce Order Complete Emails’ is closed to new replies.