Tania
Tania

Reputation: 41

Remove downloads section from email notifications in Woocommerce

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

Upvotes: 3

Views: 1532

Answers (1)

LoicTheAztec
LoicTheAztec

Reputation: 254373

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.

Upvotes: 2

Related Questions