diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php
index 8b1ae90..df68878 100644
--- a/app/Http/Controllers/ProductController.php
+++ b/app/Http/Controllers/ProductController.php
@@ -96,6 +96,7 @@ class ProductController extends Controller
'sort' => $sortBy,
'category_id' => $filter['category'] ?? null,
'gender_id' => $filter['gender'] ?? null,
+ 'brand_id' => $filter['brand'] ?? null,
'search' => $search,
'location_id' => $location_id,
'is_consignment' => $is_consignment,
@@ -142,6 +143,16 @@ class ProductController extends Controller
}
}
+ if (isset($filter['brand']) && $filter['brand']) {
+ $brand = \App\Models\Brand::find($filter['brand']);
+
+ if ($brand) {
+ $filter['brand'] = $brand->name;
+ } else {
+ unset($filter);
+ }
+ }
+
$filters = $filter;
return response()->json([
@@ -179,12 +190,17 @@ class ProductController extends Controller
$brandRepository = new \App\Repositories\Catalog\BrandRepository;
$brands = $brandRepository->getList([]);
- // Render brand HTML
+ // Render brand links HTML
$brandHtml = '';
+ $currentBrandId = $request->input('current_brand');
+
foreach ($brands as $brand) {
- $brandHtml .= '';
- $brandHtml .= '';
- $brandHtml .= '';
+ $isActive = $currentBrandId == $brand->id;
+ $brandHtml .= '