Automattic\WooCommerce\Admin\Overrides

OrderRefund::get_report_customer_id()publicWC 1.0

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

Method of the class: OrderRefund{}

No Hooks.

Return

Int|true|false. Customer ID of parent order, or false if parent order not found.

Usage

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

OrderRefund::get_report_customer_id() code WC 8.6.1

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

		if ( ! $parent_order ) {
			$this->customer_id = false;
		}

		$this->customer_id = CustomersDataStore::get_or_create_customer_from_order( $parent_order );
	}

	return $this->customer_id;
}