Automattic\WooCommerce\Admin\Overrides

OrderRefund::get_report_customer_id │ public │ WC 1.0

Get the customer ID of the parent order used for reports in the customer lookup table.

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

Хуков нет.

Возвращает

int|bool. Customer ID of parent order, or false if parent order not found.

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

$OrderRefund = new OrderRefund();
$OrderRefund->get_report_customer_id();

Код OrderRefund::get_report_customer_id() WC 11.2.2

public function get_report_customer_id() {
	if ( is_null( $this->customer_id ) ) {
		$parent_order = \wc_get_order( $this->get_parent_id() );

		$this->customer_id = $parent_order instanceof \WC_Order
			? CustomersDataStore::get_or_create_customer_from_order( $parent_order )
			: false;
	}

	return $this->customer_id;
}