Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes

CustomerHistory::get_cpt_report_customer_id │ private │ WC 1.0

Get the analytics customer ID for a CPT-backed order.

Method of the class: CustomerHistory{}

No Hooks.

Returns

int. The reports customer ID.

Usage

// private - for code of main (parent) class only
$result = $this->get_cpt_report_customer_id( $order ): int;
$order(WC_Order) (required)
The order object.

CustomerHistory::get_cpt_report_customer_id() code WC 11.3.0

private function get_cpt_report_customer_id( WC_Order $order ): int {
	if ( ! $order->get_id() ) {
		return 0;
	}

	return (int) CustomersDataStore::get_existing_customer_id_from_order( $order );
}