Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::should_sync_order()privateWC 1.0

Helper method to check whether to sync the order.

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

No Hooks.

Return

true|false. Whether the order should be synced.

Usage

// private - for code of main (parent) class only
$result = $this->should_sync_order( $order ) : bool;
$order(\WC_Abstract_Order) (required)
Order object.

Code of OrdersTableDataStore::should_sync_order() WC 7.1.0

private function should_sync_order( \WC_Abstract_Order $order ) : bool {
	$draft_order    = in_array( $order->get_status(), array( 'draft', 'auto-draft' ), true );
	$already_synced = in_array( $order->get_id(), self::$reading_order_ids, true );
	return ! $draft_order && ! $already_synced;
}