discounted prods

This commit is contained in:
merdan 2023-02-14 17:30:48 +05:00
parent 7ce4b3af23
commit 898824ae91
1 changed files with 6 additions and 2 deletions

View File

@ -112,8 +112,12 @@ class ProductRepository extends WProductRepository
}
if(isset($params['discount']) && $params['discount']){
$qb->whereNotNull('product_flat.special_price')
->where('product_flat.special_price','>',0);
$this->variantJoin($qb);
$qb->where(function($q){
$q->where('product_flat.special_price','>',0)
->orWhere('variants.special_price','>',0);
});
}
if (! core()->getConfigData('catalog.products.homepage.out_of_stock_items')) {