@php $resto = \App\Models\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID()); $resto_meta = isset($resto->resto_metas)?$resto->resto_metas:null; //dd($resto_meta); //dump($resto_meta); $resto_metas = []; $billing = []; if(isset($resto_meta)){ foreach($resto_meta as $meta){ if($meta->outlet_id!=""){ continue; } $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name; // dump($meta->resto_meta_defs); if($index_name=="BILLING_GATEWAY"){ // dump($meta->resto_meta_defs->meta_def_name); // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val; $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val); } $resto_metas[$index_name] = $meta->meta_val; } } $resto_metas['BILLING_GATEWAY'] = $billing; $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD"; $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants"; // dump($resto->default_lang); app()->setLocale($resto->default_lang); @endphp
{!! $resto->name !!}
default_lang=="en") style="direction:ltr" @endif>

Order ID: {!! $order->order_ref !!}

{{__('label.customer_name')}} : {!! $order->customer_name !!}
default_lang=="en") style="direction:ltr" @endif>
{{__('label.address')}} : @if(isset($order->customers) && isset($order->customers->customer_addresses) && $order->customers->customer_addresses->count() > 0 )) {!! ucwords($order->customers->customer_addresses[0]->label) !!} ،{!! $order->customers->customer_addresses[0]->area !!} {!! $order->customers->customer_addresses[0]->address !!} @else {!! $order->order_instructions !!} @endif
{{__('label.mobile_number')}} : {!! isset($order->customers)?(str_replace(env('COUNTRY_CODE'),'',$order->customers->users->email)):"" !!}
default_lang=="en") style="direction:ltr" @endif> @if(isset($order->orderItems) && $order->orderItems->count() > 0) @php $total_price = 0; @endphp @foreach($order->orderItems as $item) @php $total_price = $item->qty * $total_price ; @endphp @endforeach @endif
{{__('label.item_name')}} {{__('label.quantity')}} {{__('label.item_price')}} {{__('label.total_price')}}

@php $recipe = $item->recipes; $extra_price = 0; $total_price = $total_price + $item->price; $cate_name = ""; $categories = isset($recipe->categories)?$recipe->categories->pluck('category_id'):NULL; if($categories){ $categories = \App\Models\Categories::whereIn('id',$categories)->pluck('name')->toArray(); $cate_name = isset($categories[0])?$categories[0]:""; } @endphp @php $extra_options = NULL; $opt = []; if(!empty($item->extra_options)){ $extra_options = json_decode($item->extra_options); if($business_type!="ClothsStore"){ //$opt = "

    "; foreach($extra_options as $option){ $itm = \App\Models\ExtraOptionItems::find($option->id); if(isset($itm)){ $opt[] = $itm->name; // $opt.="
  • ".$itm->name.' '.number_format($itm->price,2).''; $extra_price = $extra_price+$itm->price; $total_price = $total_price+$itm->price; // dump($extra_price); if(isset($option->sub_items)){ foreach($option->sub_items as $sub){ $itm = \App\ExtraOptionItems::find($sub->sub_item_id); $extra_price = $extra_price+$itm->price; $total_price = $total_price+$itm->price; } } //$opt.="
  • "; } } // $opt.="
"; } if($business_type=="ClothsStore"){ foreach($extra_options as $option){ if(!empty($option->size) && empty($option->color)) echo ($option->size); if(empty($option->size) && !empty($option->color)){ $color = '
'; echo ($color); } if(!empty($option->size) && !empty($option->color)){ $color = '
'; echo ($option->size. " : ".$color); } } } } @endphp {!! isset($item->recipes)?$item->recipes->name:"" !!}

{!! $item->qty !!}

{!! $currency !!} {!! number_format($extra_price+$item->price) !!}

{!! $currency !!} {!! number_format($item->qty*($extra_price+$item->price)) !!}

{{__('label.delivery_fee')}} {!! $currency !!} {!! $order->delivery_fee !!}
{{__('label.total_amount')}} {!! $currency !!} {!! number_format($order->delivery_fee+$total_price) !!}

@if(isset($order->customers) && isset($order->customers->customer_addresses) && $order->customers->customer_addresses->count() > 0 )) @endif
{!! \Illuminate\Support\Facades\Auth::user()->restaurants->name !!} , {!! \Illuminate\Support\Facades\Auth::user()->restaurants->address !!} {!! \Illuminate\Support\Facades\Auth::user()->restaurants->phone_number !!}