diff --git a/app/config/services_frontend_api.yaml b/app/config/services_frontend_api.yaml index 891b6e0600..509709ea51 100644 --- a/app/config/services_frontend_api.yaml +++ b/app/config/services_frontend_api.yaml @@ -64,9 +64,6 @@ services: Shopsys\FrontendApiBundle\Model\Order\OrderRepository: alias: App\FrontendApi\Model\Order\OrderRepository - Shopsys\FrontendApiBundle\Model\Order\PlaceOrderFacade: - alias: App\FrontendApi\Model\Order\PlaceOrderFacade - Shopsys\FrontendApiBundle\Model\Parameter\ParameterWithValuesFactory: alias: App\FrontendApi\Model\Parameter\ParameterWithValuesFactory @@ -118,3 +115,7 @@ services: Shopsys\FrontendApiBundle\Model\Resolver\Products\ProductsQuery: alias: App\FrontendApi\Resolver\Products\ProductsQuery public: true + + Shopsys\FrontendApiBundle\Model\Resolver\Products\BestsellingProductsQuery: + alias: App\FrontendApi\Resolver\Products\BestsellingProductsQuery + public: true diff --git a/app/src/FrontendApi/Resolver/Products/BestsellingProductsQuery.php b/app/src/FrontendApi/Resolver/Products/BestsellingProductsQuery.php new file mode 100644 index 0000000000..bef364d8bf --- /dev/null +++ b/app/src/FrontendApi/Resolver/Products/BestsellingProductsQuery.php @@ -0,0 +1,34 @@ +getCategory() + : $categoryOrReadyCategorySeoMix; + + $bestsellingProductsIds = $this->cachedBestsellingProductFacade->getOfferedBestsellingProductIds( + $this->domain->getId(), + $category, + $this->currentCustomerUser->getPricingGroup(), + $this->productFrontendLimitProvider->getProductsFrontendLimit(), + ); + + return $this->productsSellableByIdsBatchLoader->load($bestsellingProductsIds); + } +}