I need some ideas how can I disable woocommerce customer invoice / order details email. This mail is manual, but I use WCFM vendor plugin, and when vendor changes the price in Pending status order, this email are sent to Customer.
In this documentation there are no hooks about this particular situation (https://woocommerce.com/document/unhookremove-woocommerce-emails/)
I found snippet https://www.businessbloomer.com/woocommerce-disable-customer-order-email-for-free-orders/ but it doesn’t work when I change "===" to "<" (Client still gets the email)
Second solution (didn’t worked):
remove_action( 'woocommerce_order_status_pending_to_processing_notification', array( $email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger' ) );
2
Answers
I’ve disabled the mail route in the past progammatically, perhaps this would suit this situation?
This removes the invoice email from the list at line 221 in
woocommerce/includes/class-wc-emails.php
, so when the class is called nothing will happen (besides perhaps a php notice about calling a non-existent class depending on your config).Tested and working on woo 7.3, wp 6.1.1, on both php 7.4 and 8.0