From ead3d74ba54a0fe835a05ee401478fe2dc0ad2df Mon Sep 17 00:00:00 2001 From: merdan Date: Wed, 20 Apr 2022 15:40:08 +0500 Subject: [PATCH] lasf fixes --- packages/Sarga/Shop/src/Repositories/ProductRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/Sarga/Shop/src/Repositories/ProductRepository.php b/packages/Sarga/Shop/src/Repositories/ProductRepository.php index 249789c9e..3779aede8 100644 --- a/packages/Sarga/Shop/src/Repositories/ProductRepository.php +++ b/packages/Sarga/Shop/src/Repositories/ProductRepository.php @@ -494,7 +494,7 @@ class ProductRepository extends WProductRepository public function getPopularProducts($categoryId = null) { - $count = core()->getConfigData('catalog.products.homepage.no_of_new_product_homepage'); + $results = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($categoryId) { $channel = core()->getRequestedChannelCode(); @@ -513,7 +513,7 @@ class ProductRepository extends WProductRepository ->whereIn('product_categories.category_id', explode(',', $categoryId)); } return $query->orderBy('product_flat.favoritesCount','desc'); - })->paginate($count ? $count : 4); + })->paginate(10); return $results; }