@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 }}

Seller: {{ $item->product->user->company_name ?? $item->product->user->name }}

${{ 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->payment_method)

Payment Information

Payment Method

{{ str_replace('_', ' ', ucfirst($order->payment_method)) }}

Payment Status

{{ ucfirst($order->payment_status) }}
@if($order->payment_status === 'pending')

Awaiting Payment

Please complete your payment using the selected payment method. The seller will process your order once payment is confirmed.

@endif
@endif

Order Actions

@if(auth()->user()->isSeller() && $order->seller_id === auth()->id())
@csrf
@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 about this order @endif

Contact Information

@if(auth()->user()->isBuyer())
{{ strtoupper(substr($order->seller->name, 0, 1)) }}

{{ $order->seller->company_name ?? $order->seller->name }}

Seller

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

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

Buyer

@endif
@endsection