Created
November 6, 2015 02:34
-
-
Save filipecsweb/446b7fef4c967c473a95 to your computer and use it in GitHub Desktop.
Stop sending "processing order" e-mail when WooCommerce order status changes from pending to on-hold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable action that sends e-mail to customer, warning that his/her order is processing, | |
* as this is not true, because when the status changes from pending to on-hold, | |
* the order is not processing yet. | |
* | |
* @return void | |
*/ | |
function manipulate_woocommerce_email_sending($email_class){ | |
remove_action('woocommerce_order_status_pending_to_on-hold_notification', array($email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger')); | |
add_action('woocommerce_order_status_on-hold_to_processing_notification', array($email_class->emails['WC_Email_Customer_Processing_Order'], 'trigger')); | |
} | |
add_action('woocommerce_email', 'manipulate_woocommerce_email_sending'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment