3

I need to remove the "downloads" part form order confirmations emails, at least remove the links enabling downloads from the email, independently of the order status (and if possible replace that "downloads" block by a link to invite the customer to go to their account page in order to redeem their purchase).

How could I do that?

(I found a very similar topic on this threads:
Remove product downloads section in woocommerce email notifications

Unfortunately on my case I need to remove it permanently like:

how to remove downloads on order confirmation emails

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Tania
  • 41
  • 5

1 Answers1

2

Use just the following code, that will remove downloads section from email notifications:

add_action( 'woocommerce_email', 'remove_order_downloads_from_emails', 10, 1 );
function remove_order_downloads_from_emails( $emails ){
    remove_action( 'woocommerce_email_order_details', array( $emails, 'order_downloads' ), 10 );
}

Code goes in function.php file of your active child theme (or active theme). It should work.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • works perfectly thank you! however how could I push this a little bit further and display in place of former downloads block a sentence remining to access downloads in "my account" section? (knowing that my site is in french and english, I use polylang, would I be able to find translations strings in the backoffice or do I need to code both languages?) I hope my question is clear, not sure how to put that. – Tania Aug 31 '18 at 22:25