WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Routes

AbstractCartRoute::maybe_release_stock() protected WC 1.0

If there is a draft order, releases stock.

{} It's a method of the class: AbstractCartRoute{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->maybe_release_stock();

Code of AbstractCartRoute::maybe_release_stock() WC 5.7.1

protected function maybe_release_stock() {
	$draft_order = wc()->session->get( 'store_api_draft_order', 0 );

	if ( ! $draft_order ) {
		return;
	}

	wc_release_stock_for_order( $draft_order );
}