@extends('layouts.app') @section('title', 'Customer Products') @section('css') @endsection @section('content')
@if(isset($products)) @if($products->isEmpty())
❌ No products found
@else

Search results for: "{{ request('q') }}"
({{ $products->total() }} products found)

@foreach($products as $p)
Product
{{ $p->title }}
$ {{ number_format($p->price, 2) }} - {{ str_replace('_',' ',ucfirst($p->itemcondition)) }}
@php $shelf = '-'; if (!empty($p->shelf_number)) { $decoded = json_decode($p->shelf_number, true); if (is_array($decoded)) { $shelf = $decoded[0] ?? '-'; // ambil elemen pertama } else { $shelf = $p->shelf_number; // sudah string } } @endphp
Shelf: {{ $shelf }}
View Product
@endforeach
{{ $products->appends(request()->query())->links() }}
@endif @endif @endsection @section('javascript') @endsection