Automattic\WooCommerce\StoreApi\Routes\V1
Checkout::build_draft_route_response
Build a checkout response for a session with no order in flight.
Метод класса: Checkout{}
Хуков нет.
Возвращает
\WP_REST_Response.
Использование
// private - только в коде основоного (родительского) класса $result = $this->build_draft_route_response( $request );
- $request(WP_REST_Request) (обязательный)
- Request object.
Код Checkout::build_draft_route_response() Checkout::build draft route response WC 11.0.1
private function build_draft_route_response( \WP_REST_Request $request ) {
/**
* Narrow the parent-declared schema property to the checkout subclass for phpstan.
*
* @var \Automattic\WooCommerce\StoreApi\Schemas\V1\CheckoutSchema $schema
*/
$schema = $this->schema;
return new \WP_REST_Response(
$schema->get_draft_response(
$this->cart_controller->get_cart_instance(),
wc()->customer
)
);
}