From b8d084ef29fd1610839969d9c6e4c52428e28189 Mon Sep 17 00:00:00 2001 From: Coen Jacobs Date: Tue, 17 Apr 2012 13:10:35 +0200 Subject: [PATCH] Check for set notification options before sending notification --- classes/class-wc-order.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/class-wc-order.php b/classes/class-wc-order.php index 8d984746d17..58806afc1f3 100644 --- a/classes/class-wc-order.php +++ b/classes/class-wc-order.php @@ -774,9 +774,9 @@ class WC_Order { do_action('woocommerce_product_on_backorder', array( 'product' => $_product, 'order_id' => $this->id, 'quantity' => $item['qty'])); // stock status notifications - if ( get_option('woocommerce_notify_no_stock_amount') && get_option('woocommerce_notify_no_stock_amount') >= $new_quantity ) + if ( get_option('woocommerce_notify_no_stock_amount') && get_option('woocommerce_notify_no_stock_amount') >= $new_quantity && get_option( 'woocommerce_notify_low_stock' ) == 'yes' ) do_action('woocommerce_no_stock', $_product); - elseif ( get_option('woocommerce_notify_low_stock_amount') && get_option('woocommerce_notify_low_stock_amount') >= $new_quantity ) + elseif ( get_option('woocommerce_notify_low_stock_amount') && get_option('woocommerce_notify_low_stock_amount') >= $new_quantity && get_option( 'woocommerce_notify_no_stock' ) == 'yes' ) do_action('woocommerce_low_stock', $_product); }