WordPress at Your Fingertips
function is not described

wc_update_product_stock_status() WC 1.0

Update a product's stock status.

No Hooks.

Return

null. Nothing.

Usage

wc_update_product_stock_status( $product_id, $status );
$product_id(int) (required)
Product ID.
$status(string) (required)
Status.

Code of wc_update_product_stock_status() WC 5.6.0

function wc_update_product_stock_status( $product_id, $status ) {
	$product = wc_get_product( $product_id );

	if ( $product ) {
		$product->set_stock_status( $status );
		$product->save();
	}
}