Skip to content

Commit

Permalink
fix: stop sending multiple eamil to customer when an order status is …
Browse files Browse the repository at this point in the history
…changed to completed is fixed getdokan#383
  • Loading branch information
saimonh3 committed Sep 24, 2018
1 parent 3351aa8 commit d6db168
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2877,11 +2877,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
Expand Down

0 comments on commit d6db168

Please sign in to comment.