@extends('layouts.app') @section('content')

{{ translate('Order Details') }}

@php $delivery_status = $order->orderDetails->first()->delivery_status; $payment_status = $order->orderDetails->first()->payment_status; @endphp

{{ json_decode($order->shipping_address)->name }}
{{ json_decode($order->shipping_address)->email }}
{{ json_decode($order->shipping_address)->phone }}
{{ json_decode($order->shipping_address)->address }}, {{ json_decode($order->shipping_address)->city }}, {{ json_decode($order->shipping_address)->postal_code }}
{{ json_decode($order->shipping_address)->country }}
@if ($order->manual_payment && is_array(json_decode($order->manual_payment_data, true)))
{{ translate('Payment Information') }}
{{ translate('Name') }}: {{ json_decode($order->manual_payment_data)->name }}, {{ translate('Amount') }}: {{ single_price(json_decode($order->manual_payment_data)->amount) }}, {{ translate('TRX ID') }}: {{ json_decode($order->manual_payment_data)->trx_id }}
@endif
@php $status = $order->orderDetails->first()->delivery_status; @endphp
{{translate('Order #')}} {{ $order->code }}
{{translate('Order Status')}} @if($status == 'delivered') {{ ucfirst(str_replace('_', ' ', $status)) }} @else {{ ucfirst(str_replace('_', ' ', $status)) }} @endif
{{translate('Order Date')}} {{ date('d-m-Y h:i A', $order->date) }}
{{translate('Total amount')}} {{ single_price($order->orderDetails->sum('price') + $order->orderDetails->sum('tax')) }}
{{translate('Payment method')}} {{ ucfirst(str_replace('_', ' ', $order->payment_type)) }}

@foreach ($order->orderDetails as $key => $orderDetail) @endforeach
# {{translate('Photo')}} {{translate('Description')}} {{translate('Delivery Type')}} {{translate('Qty')}} {{translate('Price')}} {{translate('Total')}}
{{ $key+1 }} @if ($orderDetail->product != null) @else {{ translate('N/A') }} @endif @if ($orderDetail->product != null) {{ $orderDetail->product->name }} {{ $orderDetail->variation }} @else {{ translate('Product Unavailable') }} @endif @if ($orderDetail->shipping_type != null && $orderDetail->shipping_type == 'home_delivery') {{ translate('Home Delivery') }} @elseif ($orderDetail->shipping_type == 'pickup_point') @if ($orderDetail->pickup_point != null) {{ $orderDetail->pickup_point->name }} ({{ translate('Pickup Point') }}) @else {{ translate('Pickup Point') }} @endif @endif {{ $orderDetail->quantity }} {{ single_price($orderDetail->price/$orderDetail->quantity) }} {{ single_price($orderDetail->price) }}
{{translate('Sub Total')}} : {{ single_price($order->orderDetails->sum('price')) }}
{{translate('Tax')}} : {{ single_price($order->orderDetails->sum('tax')) }}
{{translate('Shipping')}} : {{ single_price($order->orderDetails->sum('shipping_cost')) }}
{{translate('Discount')}} : {{ single_price($order->coupon_discount) }}
{{translate('TOTAL')}} : {{ single_price($order->grand_total) }}
@endsection @section('script') @endsection