diff --git a/src/readme.txt b/src/readme.txt index 1f9b0b9..31a4356 100644 --- a/src/readme.txt +++ b/src/readme.txt @@ -152,8 +152,11 @@ On settings page you can define a number. If location stock value will be less t == Changelog == += 2.5.7 = +- Fix: Checked the default stock value assignment from map page to cart page for the selected product with the add to cart button trigger. [Thanks to Roy Wright][04/11/2023] + = 2.5.6 = -- Fix: Product page, location selection dropdown wrapper CSS classes managed accordingly.. [Thanks to Cristian][26/10/2023] +- Fix: Product page, location selection dropdown wrapper CSS classes managed accordingly. [Thanks to Cristian][26/10/2023] = 2.5.5 = - Fix: CSV import related queries updated for the WooCommerce products stock status. [Thanks to Ole Straume Andersen][24/10/2023] diff --git a/src/src/classes/class-slw-order-item.php b/src/src/classes/class-slw-order-item.php index ee1f19d..7920242 100644 --- a/src/src/classes/class-slw-order-item.php +++ b/src/src/classes/class-slw-order-item.php @@ -439,6 +439,7 @@ public function product_stock_location_inputs( $id, $product_stock_location_term */ public function reduce_order_items_locations_stock( $order ){ + //wc_slw_logger('debug', 'reduce_order_items_locations_stock: '.'Yes'); global $current_screen; $is_shop_order = (is_object($current_screen) && isset($current_screen->post_type) && $current_screen->post_type=='shop_order'); @@ -715,7 +716,7 @@ public function wc_new_order_email_copy_to_locations_email( $headers, $email_id, */ public function newOrderItemAllocateStock( $item_id, $item, $order_id ) { - + //wc_slw_logger('debug', 'newOrderItemAllocateStock: '.'Yes #'.$order_id); // add exception to third party plugins $disallow = apply_filters( 'slw_disallow_third_party_allocate_order_item_stock', true ); diff --git a/src/src/helpers/helper-slw-mail.php b/src/src/helpers/helper-slw-mail.php index 5dd7ddc..b7e1a7d 100644 --- a/src/src/helpers/helper-slw-mail.php +++ b/src/src/helpers/helper-slw-mail.php @@ -19,7 +19,7 @@ class SlwMailHelper public static function stock_allocation_notification( $term, $item, $quantity ) { - + //wc_slw_logger('debug', 'stock_allocation_notification: '.'Yes'); if( empty($term) || empty($item) || empty($quantity) ) return; // get location meta @@ -28,7 +28,10 @@ public static function stock_allocation_notification( $term, $item, $quantity ) // get plugin settings $plugin_settings = get_option( 'slw_settings' ); // Send email notification to location - if( isset($plugin_settings['location_email_notifications']) && $plugin_settings['location_email_notifications'] == 'on' && isset($item_location_meta['slw_auto_allocate']) && $item_location_meta['slw_auto_allocate'] == '1' && isset($item_location_meta['slw_location_email']) && !empty($item_location_meta['slw_location_email']) && is_email($item_location_meta['slw_location_email']) ) { + $proceed = ( isset($plugin_settings['location_email_notifications']) && $plugin_settings['location_email_notifications'] == 'on' && isset($item_location_meta['slw_auto_allocate']) && $item_location_meta['slw_auto_allocate'] == '1' && isset($item_location_meta['slw_location_email']) && !empty($item_location_meta['slw_location_email']) && is_email($item_location_meta['slw_location_email']) ); + $proceed_inspect = isset($plugin_settings['location_email_notifications']).' - '.$plugin_settings['location_email_notifications'].' - '.isset($item_location_meta['slw_auto_allocate']).' - '.$item_location_meta['slw_auto_allocate'].' - '.isset($item_location_meta['slw_location_email']).' - '.$item_location_meta['slw_location_email'].' - '.is_email($item_location_meta['slw_location_email']); + //wc_slw_logger('debug', '$proceed: '.$proceed.' ('.$proceed_inspect.')'); + if($proceed){ $to = sanitize_slw_data( $item_location_meta['slw_location_email'] ); $subject = __('Stock allocated in', 'stock-locations-for-woocommerce') . ' ' . $term->name; $slw_stock_allocation_notification_message = sprintf(__('This is an automatically generated notification informing that the quantity of %1$d was allocated for the item %2$s with the ID %3$d.', 'stock-locations-for-woocommerce'), $quantity, $item->get_name(), $item->get_id()); diff --git a/src/src/helpers/helper-slw-order-item.php b/src/src/helpers/helper-slw-order-item.php index 1ae4c4e..77e203b 100644 --- a/src/src/helpers/helper-slw-order-item.php +++ b/src/src/helpers/helper-slw-order-item.php @@ -23,7 +23,7 @@ class SlwOrderItemHelper public static function allocateLocationStock( $orderItemId, $locationStockMap, $allocationType ) { - + //wc_slw_logger('debug', 'allocateLocationStock: '.'Yes'); // Get line item $lineItem = new \WC_Order_Item_Product($orderItemId); diff --git a/src/stock-locations-for-woocommerce.php b/src/stock-locations-for-woocommerce.php index 26d4c0b..439ebb3 100644 --- a/src/stock-locations-for-woocommerce.php +++ b/src/stock-locations-for-woocommerce.php @@ -105,7 +105,7 @@ class SlwMain{ // versions - public $version = '2.5.5'; + public $version = '2.5.7'; public $import_export_addon_version = '1.1.1'; // others