Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldsSchema

DocumentObject::get_datapublicWC 1.0

Get the data for the document object.

This isn't a 1:1 match with Store API because some data is simplified to make it easier to parse as JSON.

Method of the class: DocumentObject{}

No Hooks.

Returns

Array. The data for the document object.

Usage

$DocumentObject = new DocumentObject();
$DocumentObject->get_data();

DocumentObject::get_data() code WC 9.9.4

public function get_data() {
	// Get cart and customer objects before returning data if they are null.
	if ( is_null( $this->cart ) ) {
		$this->cart = $this->cart_controller->get_cart_for_response();
	}

	if ( is_null( $this->customer ) ) {
		$this->customer = ! empty( WC()->customer ) ? WC()->customer : new WC_Customer();
	}

	return [
		'cart'     => $this->get_cart_data(),
		'customer' => $this->get_customer_data(),
		'checkout' => $this->get_checkout_data(),
	];
}