@php /** * $product — App\Product (with product_variations.variations.variation_location_details loaded) * $colors — array row axis * $sizes — array column axis * $cells — array> * $priceBand — ['single' => bool, 'summary' => string] precomputed by controller * $tiers — array of tier summaries derived from B2BPortalSetting::cart_total_tiers * $moq — product-level MOQ display * $apiToken — portal token for links */ $summary = $priceBand['summary'] ?? ''; $singlePrice = ! empty($priceBand['single']); $currency = config('constants.currency_symbol', '₹'); @endphp
@if(!empty($product->image_url)) {{ $product->name }} @else
👕
@endif {{ $product->name }} @if($product->product_description)

{{ strip_tags($product->product_description) }}

@endif @if(!empty($moq))

MOQ: {{ $moq }} pcs

@endif
{{-- ============================ DESKTOP TABLE ============================ --}} {{-- ============================ MOBILE ACCORDION ============================ --}}
@foreach($colors as $color) @php $rowCells = collect($sizes) ->map(fn ($size) => [$size, $cells[$color][$size] ?? null]) ->filter(fn ($pair) => $pair[1] && ($pair[1]['is_active'] ?? false)); $rowStock = $rowCells->sum(fn ($pair) => (float) ($pair[1]['stock'] ?? 0)); $colorImg = $colorImages[$color] ?? null; @endphp
@if($colorImg) {{ $color }} @endif {{ $color }}
@if($rowStock > 0) {{ $rowCells->count() }} size(s) in stock @else out of stock @endif
@foreach($sizes as $size) @php $cell = $cells[$color][$size] ?? null; $vid = $cell['variation_id'] ?? null; $inStock = $cell && $cell['is_active'] && ($cell['stock'] ?? 0) > 0; @endphp
{{ $size }}
@if($inStock) @if(!$singlePrice)
{{ $currency }}{{ number_format($cell['price'], 0) }}
@endif @else
—
@endif
@endforeach
@endforeach
@if($summary) {{ $summary }} @endif @foreach(($tiers ?? []) as $tier) @if(!empty($tier['min_qty']))≥{{ $tier['min_qty'] }} pcs @endif @if(!empty($tier['discount_pct']))— {{ $tier['discount_pct'] }}% off @endif @if(!empty($tier['flat_off_per_pc']))— {{ $currency }}{{ $tier['flat_off_per_pc'] }}/pc off @endif @endforeach