Automattic\WooCommerce\StoreApi\Routes\V1

CartItems::get_route_delete_response()protectedWC 1.0

Deletes all items in the cart.

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

Хуков нет.

Возвращает

\WP_REST_Response.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_route_delete_response( $request );
$request(\WP_REST_Request) (обязательный)
Request object.

Код CartItems::get_route_delete_response() WC 8.7.0

protected function get_route_delete_response( \WP_REST_Request $request ) {
	$this->cart_controller->empty_cart();
	return new \WP_REST_Response( [], 200 );
}