Automattic\WooCommerce\Checkout\Helpers

ReserveStock::release_stock_for_order()publicWC 1.0

Release a temporary hold on stock for an order.

Метод класса: ReserveStock{}

No Hooks.

Return

null. Nothing.

Usage

$ReserveStock = new ReserveStock();
$ReserveStock->release_stock_for_order( $order );
$order(\WC_Order) (required)
Order object.

Код ReserveStock::release_stock_for_order() WC 7.1.0

public function release_stock_for_order( $order ) {
	global $wpdb;

	if ( ! $this->is_enabled() ) {
		return;
	}

	$wpdb->delete(
		$wpdb->wc_reserved_stock,
		array(
			'order_id' => $order->get_id(),
		)
	);
}