WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports\Customers

DataStore::sync_on_order_delete() public WC 1.0

Sync customers data after an order was deleted.

When an order is deleted, the customer record is deleted from the table if the customer has no other orders.

{} It's a method of the class: DataStore{}

No Hooks.

Return

null. Nothing.

Usage

$result = DataStore::sync_on_order_delete( $order_id, $customer_id );
$order_id(int) (required)
Order ID.
$customer_id(int) (required)
Customer ID.

Code of DataStore::sync_on_order_delete() WC 5.3.0

<?php
public static function sync_on_order_delete( $order_id, $customer_id ) {
	$customer_id = absint( $customer_id );

	if ( 0 === $customer_id ) {
		return;
	}

	// Calculate the amount of orders remaining for this customer.
	$order_count = self::get_order_count( $customer_id );

	if ( 0 === $order_count ) {
		self::delete_customer( $customer_id );
	}
}