WordPress at Your Fingertips
function is not described


Checkout::__construct() public WC 1.0

Constructor accepts two types of schema; one for the item being returned, and one for the cart as a whole. These may be the same depending on the route.

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

No Hooks.


null. Nothing.


$Checkout = new Checkout();
$Checkout->__construct( $cart_schema, $item_schema, $cart_controller, $order_controller );
$cart_schema(CartSchema) (required)
Schema class for the cart.
Schema class for this route's items if it differs from the cart schema.
Default: null
$cart_controller(CartController) (required)
Cart controller class.
$order_controller(OrderController) (required)
Order controller class.

Code of Checkout::__construct() WC 5.8.0

public function __construct( CartSchema $cart_schema, AbstractSchema $item_schema = null, CartController $cart_controller, OrderController $order_controller ) {
	$this->schema           = is_null( $item_schema ) ? $cart_schema : $item_schema;
	$this->cart_schema      = $cart_schema;
	$this->cart_controller  = $cart_controller;
	$this->order_controller = $order_controller;