@extends('master', ['title' => __('dashboard.order_details')]) @section('content')
{{ __('dashboard.order_info') }} #{{ $order->id }}
{{ __('dashboard.user_name') }} {{ $order->user?->name ?? '—' }}
{{ __('dashboard.date') }} {{ $order->created_at->format('Y-m-d H:i') }}
{{ __('dashboard.note') }} {{ $order->note ?? '—' }}
{{ __('dashboard.status') }}
@csrf @method('PATCH')
{{ __('dashboard.order_statuses') }}
@foreach($order->statuses as $status) @endforeach
{{ __('dashboard.status') }} {{ __('dashboard.date') }}
@if($order->currentStatus) {{ $status->getTranslation('name', app()->getLocale()) }} @else — @endif {{ $status->pivot->created_at->format('Y-m-d H:i') }}

{{ __('dashboard.items') }}

@php $subtotal = 0; @endphp @foreach($order->items as $item) @php $price = $item->product ? $item->product->getSellingPrice($item->quantity) : (float) $item->price; $item_total = $price * $item->quantity; $subtotal += $item_total; @endphp @endforeach
{{ __('dashboard.product') }} {{ __('dashboard.price') }} {{ __('dashboard.quantity') }} {{ __('dashboard.total') }}
@if ($item->product->images->first()) @else
@endif {{ $item->product->getTranslation('name', app()->getLocale()) }}
{{ number_format($price, 2) }} {{ $item->quantity }} {{ number_format($item_total, 2) }}
{{ __('dashboard.subtotal') }} {{ number_format($subtotal, 2) }}
{{ __('dashboard.delivery_price') }} {{ number_format($order->delivery_price, 2) }}
{{ __('dashboard.service_fee') }} 5
{{ __('dashboard.discount') }} -{{ number_format($order->discount, 2) }}
{{ __('dashboard.total_amount') }} {{ $order->total_amount }}
@endsection