lasf fixes

This commit is contained in:
merdan 2022-04-20 16:11:09 +05:00
parent b1237b6b1d
commit a2a6bfe3e2
1 changed files with 3 additions and 3 deletions

View File

@ -468,7 +468,6 @@ class ProductRepository extends WProductRepository
}
public function getDiscountedProducts($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();
@ -479,6 +478,8 @@ class ProductRepository extends WProductRepository
->where('product_flat.status', 1)
->where('product_flat.visible_individually', 1)
->whereNotNull('product_flat.special_price')
->where('products.type','simple')
->leftJoin('products', 'products.id', '=', 'product_flat.product_id')
->where('product_flat.special_price','>',0)
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale);
@ -488,7 +489,7 @@ class ProductRepository extends WProductRepository
->whereIn('product_categories.category_id', explode(',', $categoryId));
}
return $query->inRandomOrder();
})->paginate($count ? $count : 4);
})->paginate(10);
return $results;
}
@ -496,7 +497,6 @@ class ProductRepository extends WProductRepository
public function getPopularProducts($categoryId = null)
{
$results = app(ProductFlatRepository::class)->scopeQuery(function ($query) use ($categoryId) {
$channel = core()->getRequestedChannelCode();
$locale = core()->getRequestedLocaleCode();