@extends('layouts.app') @section('breadcrumb') Ecompk Connector / Sales Orders / {{ $sales_order->order_name }} @endsection @php $salesOrderViewCssVersion = file_exists(public_path('css/sales-order-view.css')) ? filemtime(public_path('css/sales-order-view.css')) : time(); @endphp @push('styles') @endpush @section('content') @php $has_addons = false; $allowedEditAddressEmails = [ 'najam@ecompk.com', 'saqib@ecompk-connector.com', 'admin@ecompk.com', ]; $canEditShippingAddress = Auth::check() && in_array(strtolower(Auth::user()->email), $allowedEditAddressEmails, true); foreach($sales_order_items as $sales_order_item){ if($sales_order_item->addons){ $has_addons = true; break; } } @endphp @php $assigned_courier = []; $courierQuery = App\BrandCourier::where('brand_id',$sales_order->brand_id) ->join('couriers','couriers.id','brand_couriers.courier_id') ->select('brand_couriers.*','couriers.name') ->get()->toArray(); $userCity = strtolower($sales_order_address_shipping->city); foreach($courierQuery as $key => $courierData) { $cityName = strtolower($courierData['assign_cities']); $cityArray = explode(",",$cityName); if( in_array($userCity,$cityArray) ){ $assigned_courier['courier_id'] = $courierData['courier_id']; $assigned_courier['name'] = $courierData['name']; } } @endphp @php $trackingcom = DB::table('order_fulfillment_log') ->where([ ['brand_id', $sales_order->brand_id], ['order_name', $sales_order->order_name] ]) ->value('courier_name'); @endphp
Purchased on {{ \Carbon\Carbon::parse($sales_order->created_at)->format('M d, Y - h:i a') }} ยท Customer: {{ $sales_order_customer->email }}