diff --git a/src/Controllers/Version4/Products.php b/src/Controllers/Version4/Products.php index c137842b1f9..536d9d5a5d2 100644 --- a/src/Controllers/Version4/Products.php +++ b/src/Controllers/Version4/Products.php @@ -423,12 +423,12 @@ class Products extends AbstractObjectsController { if ( $product->is_type( 'grouped' ) ) { $product->set_manage_stock( false ); - $product->set_backorders( false ); + $product->set_backorders( 'no' ); $product->set_stock_quantity( '' ); $product->set_stock_status( $stock_status ); } elseif ( $product->is_type( 'external' ) ) { $product->set_manage_stock( false ); - $product->set_backorders( false ); + $product->set_backorders( 'no' ); $product->set_stock_quantity( '' ); $product->set_stock_status( 'instock' ); } elseif ( $product->get_manage_stock() ) { diff --git a/unit-tests/Tests/Version4/Products.php b/unit-tests/Tests/Version4/Products.php index 94585a06e97..744674c8a8c 100644 --- a/unit-tests/Tests/Version4/Products.php +++ b/unit-tests/Tests/Version4/Products.php @@ -281,7 +281,7 @@ class Products extends WC_REST_Unit_Test_Case { ); $response = $this->server->dispatch( $request ); $data = $response->get_data(); - +var_dump($data); $this->assertEquals( 'Test API Update', $data['button_text'] ); $this->assertEquals( 'http://automattic.com', $data['external_url'] ); }