From b6870a6d4ccb6a949ca4b1e7a1537648e2cfa47e Mon Sep 17 00:00:00 2001 From: Saimon Sajjad Date: Fri, 28 Sep 2018 14:51:29 +0600 Subject: [PATCH] fix: stop sending multiple eamil to customer when an order status is changed to completed is fixed #383 (#385) --- includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index d4db587528..edd9bd5d6a 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -2878,11 +2878,16 @@ function dokan_stop_sending_multiple_email() { if ( did_action( 'woocommerce_order_status_pending_to_processing_notification' ) == 1 ) { dokan_remove_hook_for_anonymous_class( 'woocommerce_order_status_pending_to_processing_notification', 'WC_Email_Customer_Processing_Order', 'trigger', 10 ); } + + if ( did_action( 'woocommerce_order_status_completed_notification' ) == 1 ) { + dokan_remove_hook_for_anonymous_class( 'woocommerce_order_status_completed_notification', 'WC_Email_Customer_Completed_Order', 'trigger', 10 ); + } } add_action( 'woocommerce_order_status_pending_to_on-hold', 'dokan_stop_sending_multiple_email' ); add_action( 'woocommerce_order_status_on-hold_to_processing', 'dokan_stop_sending_multiple_email' ); add_action( 'woocommerce_order_status_pending_to_processing', 'dokan_stop_sending_multiple_email' ); +add_action( 'woocommerce_order_status_completed', 'dokan_stop_sending_multiple_email' ); /** * Remove hook for anonymous class