Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldsSchema
DocumentObject::get_data
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() DocumentObject::get data code WC 10.8.1
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(),
];
}