@extends('layouts.admin.app')
@section('title',translate('Customer_Details'))
@push('css_or_js')
@endpush
@section('customerDetails')
active
@endsection
@section('content')
@php
use App\CentralLogics\Helpers;
@endphp
@include('admin-views.customer.partials._user_details_urls')
{{translate('messages.Total Spent')}}
{{ \App\CentralLogics\Helpers::format_currency($customer->total_order_amount) }}
{{translate('messages.Last Purchase')}}
{{ $customer->lastOrder ? \App\CentralLogics\Helpers::human_time_format($customer->lastOrder->created_at) : translate('messages.N/A') }}
{{translate('messages.Avg. Order Value')}}
{{ $customer->total_order_amount > 0 && $customer->orders_count > 0 ? \App\CentralLogics\Helpers::format_currency($customer->total_order_amount / $customer->orders_count) : 0 }}
{{translate('messages.Order price range')}}
{{ \App\CentralLogics\Helpers::format_currency($orderRange->min_amount == $orderRange->max_amount ? 0 : $orderRange->min_amount) }} - {{ \App\CentralLogics\Helpers::format_currency($orderRange->max_amount ?? 0) }}
{{translate('messages.Total Ordered Items')}}
{{translate('messages.Total Ordered Restaurants')}}
{{ $restaurantsCount }}
{{ $orderRange->total_orders }}
{{ translate('Total Orders') }}
{{ $orderRange->total_delivered ?? 0 }}
{{ translate('Delivered') }}
{{ $orderRange->total_on_going ?? 0 }}
{{ translate('Ongoing') }}
{{ $orderRange->total_canceled ?? 0}}
{{ translate('Canceled') }}
{{ $orderRange->total_refunded ?? 0}}
{{ translate('Refunded') }}
{{$customer->full_name}}
{{ translate('Joined on') }} {{ \App\CentralLogics\Helpers::date_format($customer->created_at) }}
{{ translate('Phone') }}
{{$customer->phone}}
{{ translate('Email') }}
{{$customer->email}}
@php
$addressCount = $customer->addresses ? $customer->addresses()->count() : null @endphp
{{ translate('Address') }}
@if ($addressCount > 0)
{{ $addressCount }} {{ translate('Address saved') }}
@else
{{ translate('Add Address') }}
@endif
{{\App\CentralLogics\Helpers::format_currency($customer->wallet_balance)}}
{{ translate('Wallet Balance') }}
{{ $customer->loyalty_point ?? 0}}
{{ translate('Loyalty Points') }}
@forelse ($customer->addresses ?? [] as $address)
{{ $address->address_type }}
{{-- (Shipping Address) --}}
{{ translate('Name') }}
{{ $address->contact_person_name }}
({{ $address->contact_person_number }})
@if ($address->emai)
{{ translate('Email') }}
{{ $address->email }}
@endif
{{ translate('Address Type') }}
{{ ucfirst($address->address_type) }}
@if ($address->road )
{{ translate('Road') }}
{{ $address->road }}
@endif
@if ($address->house)
{{ translate('house') }}
{{ $address->house }}
@endif
@if ($address->floor)
{{ translate('Floor') }}
{{ $address->floor }}
@endif
{{ translate('Address') }}
@if ($address->latitude && $address->longitude)
{{ $address->address }}
@else
{{ $address->address }}
@endif
@empty
@endforelse
@endsection
@push('script_2')
@endpush