Automattic\WooCommerce\Internal\DataStores\Orders
OrdersTableDataStore::should_sync_order
Helper method to check whether to sync the order.
Метод класса: OrdersTableDataStore{}
Хуков нет.
Возвращает
true|false. Whether the order should be synced.
Использование
// private - только в коде основоного (родительского) класса $result = $this->should_sync_order( $order ): bool;
- $order(WC_Abstract_Order) (обязательный)
- Order object.
Код OrdersTableDataStore::should_sync_order() OrdersTableDataStore::should sync order WC 10.7.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;
}