📦 Zamówienia ({{ $orders->count() }})

← Powrót do Panelu
@if(session('ok'))
✅ {{ session('ok') }}
@endif
📮 Jak stworzyć etykietę InPost:
1. Wejdź na manager.paczkomaty.pl
2. Zaloguj się (nie potrzebujesz API - możesz utworzyć darmowe konto)
3. Kliknij "Nadaj przesyłkę" i wybierz "Paczkomat do paczkomatu"
4. Przepisz dane odbiorcy z zamówienia (imię, email, telefon, kod paczkomatu)
5. Wygeneruj etykietę i wydrukuj - gotowe! 🎉
@if($orders->count() === 0)
📭

Brak zamówień

Zamówienia pojawią się tutaj po pierwszej udanej płatności.

@else
@foreach($orders as $order)
Zamówienie #{{ $order->id }}
{{ $order->created_at->format('d.m.Y H:i') }}
{{ number_format($order->total, 2) }} zł
@csrf @method('DELETE')
Produkty
@php $items = $order->items ?? []; @endphp @if(count($items) > 0) @foreach($items as $item)
@php // Najpierw sprawdź czy zdjęcie jest zapisane w zamówieniu $mainImg = $item['main_img'] ?? null; // Jeśli nie, spróbuj znaleźć produkt if (!$mainImg) { $product = null; if (isset($item['slug'])) { $product = \App\Models\Product::where('slug', $item['slug'])->first(); } elseif (isset($item['id'])) { $product = \App\Models\Product::find($item['id']); } if ($product) { $mainImg = $product->main_img; } } @endphp @if($mainImg) {{ $item['name'] ?? 'Produkt' }} @else
📦 Brak zdjęcia
@endif
{{ $item['name'] ?? 'Produkt' }}
{{ number_format(($item['price'] ?? 0) / 100, 2) }} zł
@endforeach @else
Brak informacji o produktach
@endif
Dane klienta
@php $address = $order->shipping_address ?? []; @endphp
Imię i nazwisko: {{ $address['name'] ?? 'Brak' }}
Email: {{ $address['email'] ?? 'Brak' }}
Telefon: {{ $address['phone'] ?? 'Brak' }}
Dostawa
Metoda: {{ $order->shipping_method === 'inpost' ? 'InPost Paczkomat' : 'Kurier' }}
@if($order->shipping_method === 'inpost' && $order->parcel_locker_code)
Kod paczkomatu: {{ $order->parcel_locker_code }}
@endif @if($order->shipping_method === 'courier')
Adres: {{ $address['line1'] ?? '' }}
@if(!empty($address['line2']))
Adres 2: {{ $address['line2'] }}
@endif
Kod pocztowy: {{ $address['postal_code'] ?? '' }}
Miasto: {{ $address['city'] ?? '' }}
@endif
@endforeach
@endif