Skip to content

Commit 9eebbbe

Browse files
committed
Enhance allProducts method in ProductListController to support seller mode filtering
This commit adds functionality to the allProducts method, allowing products to be filtered based on the seller mode. It introduces a new query condition that checks for the 'seller_mode' input, enabling users to view wholesale products. Additionally, it includes logging for better traceability of the filtering process.
1 parent 5f8c098 commit 9eebbbe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/Http/Controllers/Product/ProductListController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public function allProducts(Request $request){
108108
$query->where('product_gender', $genderId);
109109
}
110110

111+
if ($request->has('seller_mode') && $request->input('seller_mode')) {
112+
$query->where('is_wholesale',1);
113+
114+
}
115+
111116
$products = $query->paginate(6);
112117

113118
return ProductResource::collection($products);

0 commit comments

Comments
 (0)