@extends('layouts.admin-layout') @section('title', 'Order Details') @section('content')

Order Details

Order Number {{ $order->order_number ?? '-' }}
User Name {{ optional($order->user)->first_name ?? 'Guest' }}
Email {{ optional($order->user)->email ?? $order->email ?? '-' }}
Phone Number {{ optional($order->user)->phone_number ?? $order->phone_number ?? '-' }}
User Type @if(optional($order->user)->is_guest) Guest @else Registered @endif
Total Price ${{ number_format($order->total_price, 2) ?? '-' }}
Total Items {{ $order->total_items ?? '-' }}
Payment Method {{ $order->payment_method ?? '-' }}
Transaction ID {{ $order->transaction_id ?? '-' }}
Status @if($order->status == 1) Active @elseif($order->status == 0) Inactive @else {{ $order->status ?? '-' }} @endif
Created At {{ $order->created_at->format('m/d/Y, h:i A') }}
Order Items
@if(isset($order->orderItems) && count($order->orderItems) > 0)
@php $counter = 1; @endphp @foreach($order->orderItems as $item) @php $priceInstance = \DB::table('prices')->where('id', $item->price_id)->first(); $currency = ($priceInstance && $priceInstance->type === 'BUY' && $item->product ) ? 'USD' : 'CAD'; @endphp @endforeach
# Product Image Product Name Quantity Price Total
{{ $counter++ }} @if($item->product && $item->product->getFirstMediaUrl('product_image')) {{ $item->product->product_name }} @else No Image @endif {{ $item->product->product_name ?? 'Product Not Found' }} @if($item->product && $item->product->slug)
Slug: {{ $item->product->slug }} @endif
{{ $item->quantity ?? 1 }} ${{ number_format($item->price ?? 0, 2) }} {{ $currency }} ${{ number_format(($item->quantity ?? 1) * ($item->price ?? 0), 2) }} {{ $currency }}
Subtotal: ${{ number_format($order->total_price, 2) }}
@else
No items found in this order.
@endif
Shipping Information

Address: {{ $order->shipping_address ?? '-' }}

City: {{ $order->city ?? '-' }}

@if($order->country_id)

Country: {{ $order->country->name ?? '' }}

@endif

Postal Code: {{ $order->postal_code ?? '-' }}

Apartments: {{ $order->apartments ?? '-' }}

@if($order->state_id)

State: {{ $order->state->name ?? '' }}

@endif
Payment Information

Payment Method: {{ ucfirst(str_replace('-', ' ', $order->payment_method)) ?? '-' }}

Transaction Status: @if($order->transaction_id) Completed @else Pending @endif

Stripe Customer ID: {{ $order->customer_id ?? '-' }}

@endsection