WordPress at Your Fingertips
function is not described


Checkout::update_order_from_request() private WC 1.0

Update the current order using the posted values from the request.

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


null. Nothing.


// private - for code of main (parent) class only
$result = $this->update_order_from_request( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of Checkout::update_order_from_request() WC 5.8.0

private function update_order_from_request( \WP_REST_Request $request ) {
	$this->order->set_customer_note( $request['customer_note'] ?? '' );
	$this->order->set_payment_method( $this->order->needs_payment() ? $this->get_request_payment_method( $request ) : '' );

	 * WooCommerce Blocks Checkout Update Order From Request (experimental).
	 * This hook gives extensions the chance to update orders based on the data in the request. This can be used in
	 * conjunction with the ExtendRestAPI class to post custom data and then process it.
	 * @internal This Hook is experimental and may change or be removed.
	 * @param \WC_Order $order Order object.
	 * @param \WP_REST_Request $request Full details about the request.
	do_action( '__experimental_woocommerce_blocks_checkout_update_order_from_request', $this->order, $request );