Skip to content

Commit

Permalink
2.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fahadmahmood8 committed Jun 12, 2024
1 parent 3b843f6 commit c22007a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ On settings page you can define a number. If location stock value will be less t


== Changelog ==
= 2.7.2 =
Fix: PHP Fatal error: Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, bool given. [Thanks to @araundu][12/06/2024]

= 2.7.1 =
- New: API and Crons are made conditional with a toggle button to turn it ON/OFF. [08/06/2024][Thanks to Nishikant Tyagi]
- New: API and Crons are made conditional with a toggle button to turn it ON/OFF. [11/06/2024][Thanks to Nishikant Tyagi]

= 2.7.0 =
- New: API and Crons are protected/restricted with the domain and IP referrer values. [08/06/2024]
Expand Down
6 changes: 3 additions & 3 deletions src/src/helpers/helper-slw-order-item.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SlwOrderItemHelper
public static function allocateLocationStock( $orderItemId, $locationStockMap, $allocationType )
{
$order_id = wc_get_order_id_by_order_item_id( $orderItemId );

$order_obj = wc_get_order($order_id);
//wc_slw_logger('debug', 'allocateLocationStock: '.'Yes #'.$order_id);


Expand Down Expand Up @@ -139,8 +139,8 @@ public static function allocateLocationStock( $orderItemId, $locationStockMap, $


// Add the note
if(method_exists($lineItem->get_order(), 'add_order_note')){
$lineItem->get_order()->add_order_note(
if(is_object($order_obj) && method_exists($order_obj, 'add_order_note')){
$order_obj->add_order_note(
sprintf(__('The stock in the location %1$s was updated in -%2$d for the product %3$s', 'stock-locations-for-woocommerce'), $term->name, $item_stock_location_subtract_input_qty, $mainProduct->get_name())
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/stock-locations-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@

class SlwMain{
// versions
public $version = '2.7.1';
public $version = '2.7.2';
public $import_export_addon_version = '1.1.1';

// others
Expand Down

0 comments on commit c22007a

Please sign in to comment.