Compare commits
2 Commits
feat/marke
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
782e6797d8 | ||
|
|
09ff7b27a5 |
@@ -29,10 +29,10 @@ class ProductController extends Controller
|
||||
// Get brand IDs to filter by (respects brand context switcher)
|
||||
$brandIds = BrandSwitcherController::getFilteredBrandIds();
|
||||
|
||||
// Get all brands for the business for the filter dropdown
|
||||
// Get all brands for the business for the filter dropdown and new product button
|
||||
$brands = \App\Models\Brand::where('business_id', $business->id)
|
||||
->orderBy('name')
|
||||
->get(['id', 'name']);
|
||||
->get(['id', 'name', 'hashid', 'logo_path', 'slug', 'updated_at']);
|
||||
|
||||
// Calculate missing BOM count for health alert
|
||||
$missingBomCount = Product::whereIn('brand_id', $brandIds)
|
||||
|
||||
@@ -78,6 +78,33 @@
|
||||
<h1 class="text-xl font-semibold text-base-content">Products</h1>
|
||||
<p class="text-sm text-base-content/50">Manage your product catalog</p>
|
||||
</div>
|
||||
@if($brands->count() > 0)
|
||||
<div class="dropdown dropdown-end" x-data="{ open: false }">
|
||||
<button @click="open = !open" class="btn btn-primary btn-sm gap-2">
|
||||
<span class="icon-[heroicons--plus] size-4"></span>
|
||||
New Product
|
||||
</button>
|
||||
<div x-show="open" @click.away="open = false" x-cloak
|
||||
class="dropdown-content mt-2 p-3 shadow-lg bg-base-100 rounded-lg w-64 border border-base-300 z-50">
|
||||
<p class="text-xs font-medium text-base-content/50 mb-2">Select a brand</p>
|
||||
<div class="space-y-1 max-h-64 overflow-y-auto">
|
||||
@foreach($brands as $brandItem)
|
||||
<a href="{{ route('seller.business.products.create', $business->slug) }}?brand={{ $brandItem->hashid }}"
|
||||
class="flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-base-200 transition-colors">
|
||||
@if($brandItem->getLogoUrl('thumb'))
|
||||
<img src="{{ $brandItem->getLogoUrl('thumb') }}" alt="{{ $brandItem->name }}" class="w-6 h-6 rounded object-contain bg-base-200">
|
||||
@else
|
||||
<div class="w-6 h-6 rounded bg-base-200 flex items-center justify-center">
|
||||
<span class="icon-[heroicons--building-storefront] size-3 text-base-content/30"></span>
|
||||
</div>
|
||||
@endif
|
||||
<span class="text-sm text-base-content">{{ $brandItem->name }}</span>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Missing BOM Alert --}}
|
||||
|
||||
Reference in New Issue
Block a user