@extends('master.back') @section('content')

{{ __('Order Details') }} - {{ $order->transaction_number }}

{{ __('Edit Order') }} {{ __('Print') }} {{ __('Back') }}
{{ __('Order Status') }}
{{ $order->order_status }}

{{ __('Order Status') }}

{{ $order->payment_status }}

{{ __('Payment Status') }}

{{ $order->payment_method }}

{{ __('Payment Method') }}

{{ $order->created_at->format('M d, Y') }}

{{ __('Order Date') }}

{{ __('Order Items') }}
@foreach($cart as $item) @php // Handle different cart data structures $item_name = isset($item['name']) ? $item['name'] : (isset($item['item']['name']) ? $item['item']['name'] : 'Product'); $item_photo = isset($item['photo']) ? $item['photo'] : (isset($item['item']['photo']) ? $item['item']['photo'] : null); // Handle price, quantity, and total calculations $main_price = isset($item['main_price']) ? $item['main_price'] : (isset($item['price']) ? $item['price'] : 0); $attribute_price = isset($item['attribute_price']) ? $item['attribute_price'] : 0; $qty = isset($item['qty']) ? $item['qty'] : 1; $unit_price = $main_price + $attribute_price; $line_total = isset($item['total']) ? $item['total'] : ($unit_price * $qty); @endphp @endforeach
{{ __('Product') }} {{ __('Price') }} {{ __('Quantity') }} {{ __('Total') }}
{{ $item_name }}
{{ $item_name }}
@if(isset($item['size']) && $item['size']) {{ __('Size') }}: {{ $item['size'] }} @endif @if(isset($item['color']) && $item['color']) {{ __('Color') }}: {{ $item['color'] }} @endif
৳{{ number_format($unit_price, 2) }} {{ $qty }} ৳{{ number_format($line_total, 2) }}
{{ __('Customer Information') }}

{{ __('Name') }}: {{ $order->user->first_name ?? 'N/A' }} {{ $order->user->last_name ?? '' }}

{{ __('Email') }}: {{ $order->user->email ?? 'N/A' }}

{{ __('Phone') }}: {{ $order->user->phone ?? 'N/A' }}

{{ __('Customer ID') }}: #{{ $order->user_id }}

{{ __('Shipping Information') }}
@php $shipping = json_decode($order->shipping_info, true); $shipping_service = json_decode($order->shipping, true); @endphp @if($shipping_service && isset($shipping_service['title']))
{{ __('Shipping Method') }}

{{ __('Service') }}: {{ $shipping_service['title'] }}

{{ __('Cost') }}: ৳{{ number_format($shipping_service['price'] ?? 0, 2) }}

@if(isset($shipping_service['is_condition']) && $shipping_service['is_condition'] == 1)

{{ __('Conditional Shipping') }} (Min: ৳{{ number_format($shipping_service['minimum_price'] ?? 0, 2) }})

@endif
@endif

{{ __('Name') }}: {{ $shipping['ship_first_name'] ?? 'N/A' }}

{{ __('Email') }}: {{ $shipping['ship_email'] ?? 'N/A' }}

{{ __('Phone') }}: {{ $shipping['ship_phone'] ?? 'N/A' }}

{{ __('Address') }}:
{{ $shipping['ship_address1'] ?? '' }}
{{ $shipping['ship_address2'] ?? '' }}
{{ $shipping['ship_city'] ?? '' }} {{ $shipping['ship_zip'] ?? '' }}
{{ $shipping['ship_country'] ?? '' }}

@if($shipping['ship_company'] ?? '')

{{ __('Company') }}: {{ $shipping['ship_company'] }}

@endif
@if(isset($shipping['pathao_city_id']) || isset($shipping['pathao_zone_id']) || isset($shipping['pathao_area_id']))
{{ __('Pathao Delivery Information') }}
@php $pathaoNames = \App\Http\Controllers\Front\CheckoutController::getPathaoNames($shipping); @endphp
@if(isset($shipping['pathao_city_id']))

{{ __('City') }}: {{ $pathaoNames['city_name'] }} (ID: {{ $shipping['pathao_city_id'] }})

@endif
@if(isset($shipping['pathao_zone_id']))

{{ __('Zone') }}: {{ $pathaoNames['zone_name'] }} (ID: {{ $shipping['pathao_zone_id'] }})

@endif
@if(isset($shipping['pathao_area_id']))

{{ __('Area') }}: {{ $pathaoNames['area_name'] }} (ID: {{ $shipping['pathao_area_id'] }})

@endif
@if(isset($shipping['pathao_shipping_cost']))

{{ __('Pathao Shipping Cost') }}: {{ '৳' }}{{($shipping['pathao_shipping_cost']) }}

@endif
@endif
{{ __('Order Summary') }}
@php $subtotal = 0; foreach($cart as $item) { // Use the same calculation logic as in the table $main_price = isset($item['main_price']) ? $item['main_price'] : (isset($item['price']) ? $item['price'] : 0); $attribute_price = isset($item['attribute_price']) ? $item['attribute_price'] : 0; $qty = isset($item['qty']) ? $item['qty'] : 1; $unit_price = $main_price + $attribute_price; $line_total = isset($item['total']) ? $item['total'] : ($unit_price * $qty); $subtotal += $line_total; } $shipping_cost = json_decode($order->shipping, true)['cost'] ?? 0; $tax = $order->tax ?? 0; $total = $subtotal + $shipping_cost + $tax; @endphp
{{ __('Subtotal') }}: ৳{{ number_format($subtotal, 2) }}
@if($ship = json_decode($order->shipping_info, true)) @php // Get shipping service details $shipping_service = json_decode($order->shipping, true); $address_shipping_cost = $ship['address_shipping_cost'] ?? 0; $pathao_shipping_cost = $ship['pathao_shipping_cost'] ?? 0; $service_shipping_cost = 0; if($shipping_service && isset($shipping_service['price'])) { $service_shipping_cost = $shipping_service['price']; } $total_shipping = $service_shipping_cost + $address_shipping_cost + $pathao_shipping_cost; @endphp @if($shipping_service && isset($shipping_service['title']))
{{ __('Shipping Method') }}: {{ $shipping_service['title'] }} (৳{{ number_format($service_shipping_cost, 2) }})
@endif @if($address_shipping_cost > 0)
{{ __('Address Shipping') }}: ৳{{ number_format($address_shipping_cost, 2) }}
@endif @if($pathao_shipping_cost > 0)
{{ __('Pathao Shipping') }}: ৳{{ number_format($pathao_shipping_cost, 2) }}
@endif @if($total_shipping > 0)
{{ __('Total Shipping') }}: ৳{{ number_format($total_shipping, 2) }}
@endif @endif @if($tax > 0)
{{ __('Tax') }}: ৳{{ number_format($tax, 2) }}
@endif
{{ __('Total') }}: @if ($setting->currency_direction == 1) {{ '৳' }}{{ PriceHelper::OrderTotal($order) }} @else {{ PriceHelper::OrderTotal($order) }}{{ '৳' }} @endif
@if($order->txnid)
{{ __('Transaction ID') }}: {{ $order->txnid }}
@endif
{{ __('Quick Actions') }}
@if(count($order->tracks_data) > 0)
{{ __('Order Tracking') }}
@foreach($order->tracks_data->sortBy('created_at') as $track)
{{ $track->title }}

{{ $track->created_at->format('M d, Y - h:i A') }}

@endforeach
@endif
@endsection