@extends('layouts.vendor.app') @section('title', translate('messages.order_details')) @push('css_or_js') @endpush @section('content')

{{ translate('messages.order') }} {{ translate('messages.details') }} {{ $order->details->count() }}

{{ translate('messages.order') }} {{ translate('messages.note') }} : {{ $order['order_note'] }}
{{ translate('messages.payment') }} {{ translate('messages.method') }} : {{ str_replace('_', ' ', $order['payment_method']) }}
{{ translate('messages.order') }} {{ translate('messages.type') }} :
@if ($order->schedule_at && $order->scheduled)
{{ translate('messages.scheduled_at') }} :
@endif
@php($sub_total = 0) @php($add_ons_cost = 0) @foreach ($order->details as $detail) @if ($detail->food)
Image Description
{{ Str::limit($detail->food['name'], 20, '...') }}
@if (count(json_decode($detail['variation'], true)) > 0) {{ translate('messages.variation') }} : @foreach (json_decode($detail['variation'], true)[0] as $key1 => $variation)
{{ $key1 }} : {{ Str::limit($variation, 15, '..') }}
@endforeach @endif @foreach (json_decode($detail['add_ons'], true) as $key2 => $addon) @if ($key2 == 0) {{ translate('messages.addons') }} : @endif
{{ Str::limit($addon['name'], 15, '...') }} : {{ $addon['quantity'] }} x {{ \App\CentralLogics\Helpers::format_currency($addon['price']) }}
@php($add_ons_cost += $addon['price'] * $addon['quantity']) @endforeach
{{ \App\CentralLogics\Helpers::format_currency($detail['price']) }}
{{ $detail['quantity'] }}
@php($amount = $detail['price'] * $detail['quantity'])
{{ \App\CentralLogics\Helpers::format_currency($amount) }}
@php($sub_total += $amount)
@elseif($detail->campaign)
Image Description
{{ Str::limit($detail->campaign['title'], 20, '...') }}
@if (count(json_decode($detail['variation'], true)) > 0) {{ translate('messages.variation') }} : @foreach (json_decode($detail['variation'], true)[0] as $key1 => $variation)
{{ $key1 }} : {{ Str::limit($variation, 15, '...') }}
@endforeach @endif @foreach (json_decode($detail['add_ons'], true) as $key2 => $addon) @if ($key2 == 0) {{ translate('messages.addons') }} : @endif
{{ Str::limit($addon['name'], 15, '...') }} : {{ $addon['quantity'] }} x {{ \App\CentralLogics\Helpers::format_currency($addon['price']) }}
@php($add_ons_cost += $addon['price'] * $addon['quantity']) @endforeach
{{ \App\CentralLogics\Helpers::format_currency($detail['price']) }}
{{ $detail['quantity'] }}
@php($amount = $detail['price'] * $detail['quantity'])
{{ \App\CentralLogics\Helpers::format_currency($amount) }}
@php($sub_total += $amount)
@endif @endforeach
{{ translate('messages.items') }} {{ translate('messages.price') }}:
{{ \App\CentralLogics\Helpers::format_currency($sub_total) }}
{{ translate('messages.addon') }} {{ translate('messages.cost') }}:
{{ \App\CentralLogics\Helpers::format_currency($add_ons_cost) }}
{{ translate('messages.subtotal') }}:
{{ \App\CentralLogics\Helpers::format_currency($sub_total + $add_ons_cost) }}
{{ translate('messages.discount') }}:
- {{ \App\CentralLogics\Helpers::format_currency($order['restaurant_discount_amount']) }}
{{ translate('messages.coupon') }} {{ translate('messages.discount') }}:
- {{ \App\CentralLogics\Helpers::format_currency($order['coupon_discount_amount']) }}
{{ translate('messages.vat/tax') }}:
+ {{ \App\CentralLogics\Helpers::format_currency($order['total_tax_amount']) }}
{{ translate('messages.delivery') }} {{ translate('messages.fee') }}:
@php($del_c = $order['delivery_charge']) + {{ \App\CentralLogics\Helpers::format_currency($del_c) }}
{{ translate('messages.total') }}:
{{ \App\CentralLogics\Helpers::format_currency($sub_total + $del_c + $order['total_tax_amount'] + $add_ons_cost - $order['coupon_discount_amount'] - $order['restaurant_discount_amount']) }}
@if ($order['order_type'] != 'take_away')

{{ translate('messages.deliveryman') }}

@if ($order->delivery_man)
Image Description
{{ $order->delivery_man['f_name'] . ' ' . $order->delivery_man['l_name'] }}
{{-- --}}

{{ $order->delivery_man->orders->count() }} {{ translate('messages.orders') }}
{{-- --}}

{{ translate('messages.contact') }} {{ translate('messages.info') }}
@if ($order['order_type'] != 'take_away')
@php($address = $order->dm_last_location)
{{ translate('messages.last') }} {{ translate('messages.location') }}
@if (isset($address)) {{ $address['location'] }}
@else {{ translate('messages.location') . ' ' . translate('messages.not_found') }} @endif @endif @else {{ translate('messages.deliveryman') . ' ' . translate('messages.not_found') }} @endif
@endif

{{ translate('messages.customer') }}

@if ($order->customer)
{{ \App\Models\Order::where('user_id', $order['user_id'])->count() }} {{ translate('messages.orders') }}

{{ translate('messages.contact') }} {{ translate('messages.info') }}
@else {{translate('messages.walk_in_customer')}} @endif @if ($order->delivery_address) @php($address = json_decode($order->delivery_address, true))
{{ translate('messages.delivery') }} {{ translate('messages.info') }}
@if (isset($address)) {{ translate('messages.name') }}: {{ $address['contact_person_name'] }}
{{ translate('messages.contact') }}: {{ $address['contact_person_number'] }}
{{ translate('messages.address') }}: {{ $address['address'] }}
@if ($order['order_type'] != 'take_away' && isset($address['address'])) @if (isset($address['latitude']) && isset($address['longitude'])) {{ $address['address'] }}
@else {{ $address['address'] }}
@endif @endif
@endif @endif
@endsection @push('script_2') @endpush