set_backorders

This commit is contained in:
Mike Jolley 2019-06-13 15:33:56 +01:00
parent cd847fb4ea
commit f927305443
2 changed files with 3 additions and 3 deletions

View File

@ -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() ) {

View File

@ -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'] );
}