@extends('layouts.app') @section('title', 'Order ' . $order->order_number) @section('content')

Order #{{ $order->order_number }}

Placed on {{ $order->order_date->format('M j, Y g:i A') }}

{{ $order->items->sum('quantity') }}
Items
${{ number_format($order->total_amount, 2) }}
Total Amount
{{ ucfirst($order->status) }}
Order Status
{{ ucfirst($order->payment_status) }}
Payment

Order Items

@foreach($order->items as $item)
{{ $item->product->name }}

{{ $item->product->name }}

Your Product

${{ number_format($item->unit_price, 2) }}

Qty: {{ $item->quantity }}

${{ number_format($item->total_price, 2) }}

@endforeach

Shipping Information

Shipping Address

{{ $order->shipping_address }}

Order Notes

{{ $order->notes ?: 'No special instructions' }}

@if($order->shipments->count() > 0)

Shipment Tracking

@foreach($order->shipments as $shipment)

{{ $shipment->carrier }}

Tracking #: {{ $shipment->tracking_number }}

{{ ucfirst($shipment->status) }}

Shipped Date

{{ $shipment->shipment_date->format('M j, Y') }}

Est. Delivery

{{ $shipment->estimated_delivery->format('M j, Y') }}

@endforeach
@endif

Order Actions

@csrf
@if($order->status === 'confirmed' || $order->status === 'pending') @endif @if($order->shipments->count() > 0) Print Shipping Label @endif @php $chat = \App\Models\Chat::where('product_id', $order->items->first()->product_id) ->where('buyer_id', $order->buyer_id) ->where('seller_id', $order->seller_id) ->first(); @endphp @if($chat) Chat with Buyer @endif

Buyer Information

{{ strtoupper(substr($order->buyer->name, 0, 1)) }}

{{ $order->buyer->name }}

{{ $order->buyer->email }}

@if($order->buyer->company_name)

{{ $order->buyer->company_name }}

@endif
@endsection