@extends('layouts.app') @section('title', 'External Catalogue') @section('content')
@php $prefix = strtolower($prefix); // ensure case-insensitive matching @endphp

@if ($prefix === 'bullion') Bars and Coins Product Listing @elseif ($prefix === 'preowned') Preowned Product Listing @elseif ($prefix === 'diamond') Diamond Product Listing @else Product Listing @endif

@if (($products->count() ?? 0) === 0)
@else @foreach ($products as $p)
{{ $p['title'] }} @php $isFavorited = in_array( $p['external_id'], $favoritedIds, ); @endphp
WG:{{ number_format($p['weight_g'] ?? 0, 3) }} g
{{ $p['brand'] }} | SKU: {{ $p['sku'] }}
{{ \Illuminate\Support\Str::limit($p['title'], 12) }}
@if ($p['availability'] === 'pre_order')

Pre Order

@elseif($p['availability'] === 'in_stock')

In Stock

@else

Sold Out

@endif

Less then £ {{ number_format($p['display_price'] ?? 0, 2) }}

@if (!empty($p['url'])) @else @endif {{-- --}}
Quantity Each
1 £3,103.00
2+ £3,099.90
5+ £3,096.90
10+ £3,093.90
25+ £3,090.90
@endforeach @endif
{{-- pagination (only show when there are results and multiple pages) --}} @if (($products->count() ?? 0) > 0 && method_exists($products, 'hasPages') && $products->hasPages())
@endif
{{-- Simple pager (compute from page/per_page/total) --}} @php $last = (int) ceil(($total ?? 0) / max(1, $per_page ?? 12)); $cur = $page ?? 1; @endphp
@if ($cur > 1) Prev @endif @if ($cur < $last) Next @endif
@push('scripts') @endpush @push('scripts') {{-- --}} {{-- --}} @endpush @endsection