Automattic\WooCommerce\Internal\DataStores\Orders

OrdersTableDataStore::should_sync_orderprivateWC 1.0

Helper method to check whether to sync the order.

Method of the class: OrdersTableDataStore{}

No Hooks.

Returns

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.

OrdersTableDataStore::should_sync_order() code WC 10.3.3

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;
}