Skip to content

Commit

Permalink
2.5.7
Browse files Browse the repository at this point in the history
fahadmahmood8 committed Nov 4, 2023
1 parent f3a9e54 commit 0778a3c
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/readme.txt
Original file line number Diff line number Diff line change
@@ -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]
3 changes: 2 additions & 1 deletion src/src/classes/class-slw-order-item.php
Original file line number Diff line number Diff line change
@@ -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 );
7 changes: 5 additions & 2 deletions src/src/helpers/helper-slw-mail.php
Original file line number Diff line number Diff line change
@@ -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 <strong>%1$d</strong> was allocated for the item <strong>%2$s</strong> with the ID <strong>%3$d</strong>.', 'stock-locations-for-woocommerce'), $quantity, $item->get_name(), $item->get_id());
2 changes: 1 addition & 1 deletion src/src/helpers/helper-slw-order-item.php
Original file line number Diff line number Diff line change
@@ -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);

2 changes: 1 addition & 1 deletion src/stock-locations-for-woocommerce.php
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0778a3c

Please sign in to comment.