Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldsSchema

DocumentObject::get_data()publicWC 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.

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

Хуков нет.

Возвращает

Массив. The data for the document object.

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

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

Код DocumentObject::get_data() WC 9.8.5

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(),
	];
}