{{-- ── TAB 1: Packaged Water ────────────────────── --}}
@if($packaged_products->count() > 0)
@endif
{{-- ── TAB 2: Refill Water ─────────────────────── --}}
@if($refill_products->count() > 0)
@endif
{{-- tab-content --}}
@foreach ($packaged_products as $product)
@php
$hasVariants = $product->variants->count() > 0;
if ($hasVariants) {
$variants = $product->variants->where('variant_status', '!=', 'inactive');
$isDual = $variants->whereIn('selling_unit', ['bottle','pack'])->count() > 0;
$anyStock = $variants->sum('variant_quantity') > 0;
$minPrice = $variants->min('variant_price');
} else {
$variants = collect([]);
$isDual = false;
$anyStock = $product->product_quantity > 0;
$minPrice = $product->product_price;
}
@endphp
@if($hasVariants) @if($isDual) Bottle / Pack
@endif @if($anyStock) Choose Size @else No Stock @endif @else Stock: {{ $product->product_quantity }} @if($anyStock) Add to Cart @else Out of stock @endif @endif
@endforeach
📦
{{ $product->product_name }}
KES {{ number_format($minPrice, 2) }}@if($hasVariants) @if($isDual) Bottle / Pack
@endif @if($anyStock) Choose Size @else No Stock @endif @else Stock: {{ $product->product_quantity }} @if($anyStock) Add to Cart @else Out of stock @endif @endif
@foreach ($refill_products as $refill)
@endforeach
Refills have no stock limit – they are served from the main tank.