@extends('backend.admin.layouts.app') @section('title', ucfirst(Request::segment(2))) @section('content')

Sender Details

@php $sender = App\Models\User::where('id', $order->customer_id)->first(); @endphp
@if (isset($order->user))
Name: {{ $order->user->name }}
Phone: {{ $order->user->phone }}
Email: {{ $order->user->email }}
Country: {{ $order->user->country->name }}
Address: {{ $order->user->address }}
@endif Paid Via: {{ App\Models\BankAccount::where('id', $order->payment_bank_id)->value('bank_name') }}, {{ $order->total }}
@if (isset($order->user_wallet)) Paid Via: User Wallet, {{ $order->user_wallet }}
@endif Trx ID: {{ $order->trx_id }}

Receiver Details

@php $country = App\Models\Country::where('id', $order->receiver_country)->first(); @endphp
Name: {{ ucwords(!empty($order->receiver_name) ? $order->receiver_name : '') }}
Phone: {{ $order->receiver_phone }}
Email: {{ $order->receiver_email }}
Country: {{ $country->name }}
City: {{ App\Models\City::where('id', $order->receiver_city)->value('name') }}
@if ($country->name == 'Indonesia') Address: {{ $order->receiver_address_rtrw }}
@else Address: {{ $order->receiver_address }}
@endif

Receipt

Order Summary

Order# ET{{ $order->id }}
@php $sno = 0; @endphp @foreach ($order->details as $key => $row) @php $sno++ @endphp @endforeach
No. Item Color Size Label Variation Delivery Date Qty Price Sub total
{{ $sno }} {{-- "id" => 61 "product_id" => 22 "order_id" => 45 "quantity" => "1" "color_id" => 13 "weight_id" => null "size" => "XL" "price" => "16.57" "delivery_date" => null "created_at" => null "updated_at" => null --}} @if (!empty($row->variant_id)) @php $ProductVariant = App\Models\ProductVariant::where( 'id', $row->variant_id, )->first(); @endphp  @else @endif @php $variant_Color = App\Models\Color::where( 'id', $row->color_id, )->first(); @endphp {{ optional($variant_Color)->name }}
{{ $row->size }} {{ $row->product->variation_label }} - @php $labelVariant = App\Models\Weight::where( 'id', $row->weight_id, )->first(); $labelVariant1 = App\Models\ProductVariant::where( 'id', $row->variant_id, )->first(); @endphp {{ optional($labelVariant)->name }}
{{-- variant: {{ $row->variant_id }}
--}} {{-- NEW: {{ optional($labelVariant1)->name}} --}} {{--

                                                                {{ print_r($labelVariant )}}
                                                            
--}}
{{ $row->delivery_date }} {{ $row->quantity }} {{-- {{ $order->sender_currency }} --}} ${{ $row->price }} {{-- {{ $order->sender_currency }} --}} ${{ $row->quantity * $row->price }}
Total {{ $order->sender_currency }} {{ number_format($order->total) }}
{{-- --}}

History

@if ($order->status == 'pending') @elseif($order->status == 'ready for delivery') @elseif($order->status == 'on delivery') @elseif($order->status == 'dilerved') @elseif($order->status == 'cancelled') @endif

@if ($order->courier)

Assigned to: {{ $order->courier->name }}
Tracking ID: {{ $order->courier_tracking_id }}
Assigned Date: {{ $order->courier_tracking_date }}

@endif
@php $statuses = $order->statuses; @endphp @foreach ($statuses as $key => $status) @endforeach
{{ date('d-m-Y H:i:s A', strtotime($status->date_time)) }} {{ $status->status }}
@if (!empty($order->wishingcard_id)) @php $wishing = App\Models\WishingCard::where('id', $order->wishingcard_id)->first(); @endphp

Wishing Card

{{ $wishing->title }}

@endif
@endsection