diff --git a/includes/updates/woocommerce-update-2.4.php b/includes/updates/woocommerce-update-2.4.php index 5fa30e54b8b..b51b386fb83 100644 --- a/includes/updates/woocommerce-update-2.4.php +++ b/includes/updates/woocommerce-update-2.4.php @@ -148,6 +148,12 @@ $refunded_orders = get_posts( array( 'post_status' => array( 'wc-refunded' ) ) ); +// Ensure emails are disabled during this update routine +remove_all_actions( 'woocommerce_order_status_refunded_notification' ); +remove_all_actions( 'woocommerce_order_partially_refunded_notification' ); +remove_action( 'woocommerce_order_status_refunded', array( 'WC_Emails', 'send_transactional_email' ) ); +remove_action( 'woocommerce_order_partially_refunded', array( 'WC_Emails', 'send_transactional_email' ) ); + foreach ( $refunded_orders as $refunded_order ) { $order_total = get_post_meta( $refunded_order->ID, '_order_total', true ); $refunded_total = $wpdb->get_var( $wpdb->prepare( " diff --git a/readme.txt b/readme.txt index 94708837c65..a6db183db96 100644 --- a/readme.txt +++ b/readme.txt @@ -159,6 +159,9 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc == Changelog == += 2.4.1 - 10/08/2015 = +* Fix - Tweaked the 2.4 upgrade routine to disable refund emails during update. + = 2.4.0 - 10/08/2015 = * Feature - Onboarding/setup wizard for new users to handle basic store settings and installation. * Feature - Improved help tabs with inline video tutorials where applicable.