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' }}]({{ asset('storage/' . $mainImg) }})
@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