@extends('backend.layouts.app') @section('title', $title) @section('content')
Order details ({{$order->code}})

{{$order->user->fullname()}} {{$order->user->roles()->first()->name}}

{{$order->user->email}}

+{{$order->user->country_code}}{{$order->user->phone}}

ID: {{$order->id}}

Code: {{$order->code}}

Created at:: {{$order->created_at->format('d/m/Y')}}

Currency: {{$order->currency->name}}

@if(!is_null($order->coupon_id))

Coupon: {{$order->coupon->code}}

@endif

Country: {{$order->address->city->country->name}}

City: {{$order->address->city->name}}

Address: {{$order->address->address}}

Street: {{$order->address->street}}

@if(!is_null($order->address->flat_number))

Flat: {{$order->address->flat_number}}

@endif @if(!is_null($order->address->villa_number))

Villa: {{$order->address->villa_number}}

@endif @if(!is_null($order->address->postal_code))

Postal: {{$order->address->postal_code}}

@endif

Payment: {{$order->payment->name}}

@if(!is_null($order->invoice_id))

Invoice id: {{$order->invoice_id}}

@endif

Points earned: {{$order->points_earned}}

Tax: {{Helper::calculatePrice($order->tax, $order->currency->getTranslation('code', 'en'))}} {{$order->currency->code}}

Shipping cost: {{Helper::calculatePrice($order->shipping_cost, $order->currency->getTranslation('code', 'en'))}} {{$order->currency->code}}

Subtotal: {{Helper::calculatePrice($order->subtotal, $order->currency->getTranslation('code', 'en'))}} {{$order->currency->code}}

Total: {{Helper::calculatePrice($order->total, $order->currency->getTranslation('code', 'en'))}} {{$order->currency->code}}

@if($order->deduct_from_wallet != 0)

Deduct from wallet: {{Helper::calculatePrice($order->deduct_from_wallet, $order->currency->getTranslation('code', 'en'))}} {{$order->currency->code}}

@endif @if($order->deduct_from_points != 0)

Deduct from points: {{Helper::calculatePrice(Helper::convertPointsToCurrency($order->deduct_from_points), $order->currency->getTranslation('code', 'en'))}} (Points: {{$order->deduct_from_points}})

@endif

@php $deliveryColor = match ($order->delivery_status) { \App\Enums\OrderDeliveryStatus::PENDING,\App\Enums\OrderDeliveryStatus::CANCELLED,\App\Enums\OrderDeliveryStatus::RETURNED => "danger", \App\Enums\OrderDeliveryStatus::PROCESSED,\App\Enums\OrderDeliveryStatus::SHIPPED => "warning", \App\Enums\OrderDeliveryStatus::DELIVERED => "success", }; $paymentColor = match ($order->payment_status) { \App\Enums\OrderPaymentStatus::PENDING,\App\Enums\OrderPaymentStatus::FAILED,\App\Enums\OrderPaymentStatus::REFUNDED,\App\Enums\OrderPaymentStatus::CANCELLED => "danger", \App\Enums\OrderPaymentStatus::PAID => "success", }; @endphp Delivery status: {{$order->delivery_status}}

Payment status: {{$order->payment_status}}

@if(!is_null($order->notes))

Notes: {{$order->notes}}

@endif
Order Status
@csrf @method('PUT')
Delivery status *
Payment status *
Order items
@foreach($order->orderDetails as $key => $item) @endforeach
Product Color Size Quantity Unit price
{{$item->product->name}} {{$item->product->name}} {{$item->variation->color->name}}
@if(isset($item->variation->size->size)) {{$item->variation->size->size}} {{$item->variation->size->unit}} @else N/A @endif {{$item->quantity}} {{Helper::calculatePrice($item->unit_price, $order->currency->getTranslation('code', 'en'))}} {{$order->currency->code}}
@if(!is_null($order->coupon_id))
Coupon

Code:{{$order->coupon->code}}

@if($order->coupon->isFreeShippingCoupon())

Free shipping

@else

Type:{{$order->coupon->discount_type}}

Discount:{{$order->coupon->discount}} AED

@endif
@endif
@endsection