@extends('layouts.dashboard') @section('title',trans('layout.order_details')) @section('main-content')
{{trans('layout.details')}} {{trans('layout.order')}} #{{$order->id}} {{trans('layout.status')}}: {{$order->status}}
{{trans('layout.customer')}}:
{{$order->name}}
@if($order->user)
{{trans('layout.email')}}: {{$order->user->email}}
@endif
{{trans('layout.phone')}}: {{$order->phone_number}}
@if($order->type=='delivery')
{{trans('layout.delivery_address')}}: {{$order->address}}
@endif
@php $discount=0;$totalTax=0; @endphp @foreach($order->details as $key=>$details) @php $discount+=$details->discount; @endphp @php $totalTax+=$details->tax_amount; @endphp @endforeach
# {{trans('layout.item')}} {{trans('layout.quantity')}} {{trans('layout.price')}} {{trans('layout.discount')}} {{trans('layout.tax')}} {{trans('layout.total_price')}}
{{$key+1}} {{$details->item->name}} @if($order->extras()->where('item_id',$details->item_id)->count()>0)
{{trans('layout.extra')}}: @foreach($order->extras()->where('item_id',$details->item_id)->get() as $key=>$extra) {{$extra->quantity}} {{$extra->title}}@if($key<$order->extras()->where('item_id',$details->item_id)->count()-1) ,@endif @endforeach @endif
{{$details->quantity}} {{formatNumber($details->item->price)}} {{formatNumber($details->discount)}} {{formatNumber($details->tax_amount)}} {{formatNumber($details->total+$details->tax_amount)}} @if($order->extras()->where('item_id',$details->item_id)->count()>0)
@php $totalExtra=0 @endphp {{trans('layout.extra')}}: @foreach($order->extras()->where('item_id',$details->item_id)->get() as $key=>$extra) @php $totalExtra+=($extra->price*$extra->quantity) @endphp @endforeach {{formatNumber($totalExtra)}} @endif
@if($order->comment) {{trans('layout.comment')}}:
{{$order->comment}} @endif
{{trans('layout.total_discount')}} {{formatNumberWithCurrSymbol($discount)}}
{{trans('layout.total_tax')}} {{formatNumberWithCurrSymbol($totalTax)}}
{{trans('layout.total')}} {{formatNumberWithCurrSymbol($order->total_price)}}
@endsection @section('js') @endsection