From bc0c79a901a443fa2f9a7ed706ae6bc53e5acd9d Mon Sep 17 00:00:00 2001 From: James Flacks Date: Tue, 1 Feb 2022 18:06:53 +0000 Subject: [PATCH] Page Size is set in the search Criteria Builder Page Size is not set like that, you set it in the SearchCriteriaBuilder - I have an account with thousands of test orders, checkout takes 85 seconds to load. This fixes it. --- Model/Service/OrderHandlerService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Service/OrderHandlerService.php b/Model/Service/OrderHandlerService.php index f4c8d6ba..a5bfd4e4 100644 --- a/Model/Service/OrderHandlerService.php +++ b/Model/Service/OrderHandlerService.php @@ -221,14 +221,14 @@ public function findOrderByFields($fields) $value ); } - + $this->searchBuilder->setPageSize(1); + // Create the search instance $search = $this->searchBuilder->create(); // Get the resulting order $order = $this->orderRepository ->getList($search) - ->setPageSize(1) ->getLastItem(); if ($order->getId()) {