From af6ee6d4202d7778d3c75f5b5ddd988cf8e8adb4 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 8 Feb 2017 16:19:13 +0000 Subject: [PATCH] Fix; wrong method calls --- includes/api/class-wc-rest-products-controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/api/class-wc-rest-products-controller.php b/includes/api/class-wc-rest-products-controller.php index 30f5d380de8..069f7869e62 100644 --- a/includes/api/class-wc-rest-products-controller.php +++ b/includes/api/class-wc-rest-products-controller.php @@ -1236,7 +1236,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { if ( isset( $request['stock_quantity'] ) ) { $product->set_stock_quantity( wc_stock_amount( $request['stock_quantity'] ) ); } elseif ( isset( $request['inventory_delta'] ) ) { - $stock_quantity = wc_stock_amount( $product->get_stock_amount() ); + $stock_quantity = wc_stock_amount( $product->get_stock_quantity() ); $stock_quantity += wc_stock_amount( $request['inventory_delta'] ); $product->set_stock_quantity( wc_stock_amount( $stock_quantity ) ); } @@ -1441,7 +1441,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller { if ( isset( $data['stock_quantity'] ) ) { $variation->set_stock_quantity( $data['stock_quantity'] ); } elseif ( isset( $data['inventory_delta'] ) ) { - $stock_quantity = wc_stock_amount( $variation->get_stock_amount() ); + $stock_quantity = wc_stock_amount( $variation->get_stock_quantity() ); $stock_quantity += wc_stock_amount( $data['inventory_delta'] ); $variation->set_stock_quantity( $stock_quantity ); }