diff --git a/includes/API.php b/includes/API.php index 2a7e75f..1d632a4 100644 --- a/includes/API.php +++ b/includes/API.php @@ -240,6 +240,17 @@ public function rest_index( WP_REST_Response $response ): WP_REST_Response { $response->data['wcpos_version'] = VERSION; $response->data['use_jwt_as_param'] = woocommerce_pos_get_settings( 'tools', 'use_jwt_as_param' ); + /** + * Remove the routes from the response. + * + * Some wordpress sites have a huge number of routes, like 2MB of data. It shouldn;t matter, but it seems + * to cause issues with the desktop application sometimes. We don't use the routes at the moment, so we + * can remove them from the response. + */ + $data = $response->get_data(); + unset( $data['routes'] ); + $response->set_data( $data ); + return $response; } diff --git a/includes/API/Orders_Controller.php b/includes/API/Orders_Controller.php index ecd0048..7e03b27 100644 --- a/includes/API/Orders_Controller.php +++ b/includes/API/Orders_Controller.php @@ -671,6 +671,9 @@ public function wcpos_shop_order_query( array $args, WP_REST_Request $request ) ); } + // @TODO - Add 'created_via' filter. + // 'created_via' is stored in the operational data table for HPOS and postmeta for legacy. + return $args; }