diff --git a/README.md b/README.md index ecacefe..98d9905 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ -# woocommerce-module \ No newline at end of file +woocommerce-module +================== + +Module allows integrate Woocommerce with [retailCRM](http://retailcrm.pro) \ No newline at end of file diff --git a/retailcrm/include/class-wc-retailcrm-inventories.php b/retailcrm/include/class-wc-retailcrm-inventories.php index beaea6a..d5dc4ef 100644 --- a/retailcrm/include/class-wc-retailcrm-inventories.php +++ b/retailcrm/include/class-wc-retailcrm-inventories.php @@ -42,11 +42,14 @@ if ( ! class_exists( 'WC_Retailcrm_Inventories' ) ) : if (isset($offer['externalId'])) { $product = wc_get_product($offer['externalId']); - if ($product == false || $product->get_type() == 'variable') continue; - - update_post_meta($offer['externalId'], '_manage_stock', 'yes'); - $product->set_stock_quantity($offer['quantity']); - $product->save(); + if ($product != false) { + if ($product->get_type() == 'variable') { + continue; + } + update_post_meta($offer['externalId'], '_manage_stock', 'yes'); + $product->set_stock_quantity($offer['quantity']); + $product->save(); + } } }