From 21596b189d508be0398865d657e0c391c4850aef Mon Sep 17 00:00:00 2001 From: Devansh Date: Thu, 16 Jul 2020 12:29:56 +0530 Subject: [PATCH] Limit 0 Issue Fixed --- .../Webkul/Product/src/Repositories/ProductRepository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 9d0b0e8a4..690d6658d 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -113,7 +113,7 @@ class ProductRepository extends Repository $perPage = isset($params['limit']) ? $params['limit'] : current($pages); } else { - $perPage = isset($params['limit']) ? $params['limit'] : 9; + $perPage = isset($params['limit']) && !empty($params['limit']) ? $params['limit'] : 9; } $page = Paginator::resolveCurrentPage('page'); @@ -388,7 +388,7 @@ class ProductRepository extends Repository ->where('product_flat.channel', $channel) ->where('product_flat.locale', $locale) ->whereNotNull('product_flat.url_key') - ->where(function($subQuery) use ($term) { + ->where(function($subQuery) use ($term) { $queries = explode('_', $term); foreach (array_map('trim', $queries) as $value) { @@ -399,7 +399,7 @@ class ProductRepository extends Repository ->orderBy('product_id', 'desc'); })->paginate(16); } - + return $results; }