@php $customer = $this->customer; @endphp
← {{ __('Back to inbox') }}
@if ($customer === null)
{{ __('Customer not available in this workspace.') }}
@else {{-- Header --}}
@if ($customer->badge) {{ $customer->badge->emoji() }} @endif {{ $customer->name ?: $customer->email }} @if ($this->shopifyCustomer) {{ __('Shopify customer') }} @endif
@if ($customer->email) {{ $customer->email }} @endif @if ($customer->phone) · {{ $customer->phone }} @endif
{{-- Badge dropdown + lifetime spend. Same controls as the inbox right-sidebar — all members can change a badge. The £-prefixed row hides at zero so a brand-new customer doesn't show a meaningless £0.00. --}}
@php $lifetimeSpend = $this->customerLifetimeSpend; @endphp @if ($lifetimeSpend > 0)
{{ __('Lifetime spend') }}
£{{ number_format($lifetimeSpend, 2) }}
@endif
{{-- Shopify customer summary --}} @if ($this->shopifyCustomer)
{{ __('Shopify customer summary') }}
@if ($this->shopifyCustomer->first_name || $this->shopifyCustomer->last_name)
{{ __('Name on file') }}
{{ trim(($this->shopifyCustomer->first_name ?? '').' '.($this->shopifyCustomer->last_name ?? '')) ?: '—' }}
@endif @if ($this->shopifyCustomer->orders_count !== null)
{{ __('Orders on file') }}
{{ number_format($this->shopifyCustomer->orders_count) }}
@endif @if ($this->shopifyCustomer->total_spent !== null)
{{ __('Total spent') }}
{{ $this->shopifyCustomer->total_spent }}
@endif @if ($this->shopifyCustomer->synced_at)
{{ __('Last synced') }}
{{ \Illuminate\Support\Carbon::parse($this->shopifyCustomer->synced_at)->diffForHumans() }}
@endif
@endif {{-- All Shopify orders, across every store this customer has touched. Searchable. The container always renders when the customer has any orders so the search input stays visible (otherwise typing a too-narrow filter would unmount the search box entirely). --}} @if ($this->totalShopifyOrdersCount > 0)
{{ __('Shopify orders') }} @if (trim($ordersSearch) === '') {{ __(':n total', ['n' => number_format($this->totalShopifyOrdersCount)]) }} @else {{ __(':showing of :total match', [ 'showing' => number_format($this->recentShopifyOrders->count()), 'total' => number_format($this->totalShopifyOrdersCount), ]) }} @endif
@if (trim($ordersSearch) !== '') {{ __('Clear') }} @endif
@if ($this->recentShopifyOrders->isEmpty())

{{ __('No orders match this search.') }}

@else
@foreach ($this->recentShopifyOrders as $order) @endforeach
{{ __('Order') }} {{ __('Date') }} {{ __('Status') }} {{ __('Total') }} {{ __('Store') }}
{{ $order->shopify_order_name ?? '#'.$order->shopify_order_id }} {{ $order->processed_at?->diffForHumans() ?? '—' }} @if ($order->cancelled_at) {{ __('Cancelled') }} @else {{ $order->financial_status ?? '—' }} @if ($order->fulfillment_status) · {{ $order->fulfillment_status }} @endif @endif {{ $order->total_price ?? '—' }} {{ $order->currency }} {{ $order->store?->name ?? '—' }}
@if ($this->recentShopifyOrders->count() >= \App\Livewire\Customers\Show::ORDERS_RESULT_CAP)

{{ __('Showing the most recent :n. Use the search to narrow further.', ['n' => \App\Livewire\Customers\Show::ORDERS_RESULT_CAP]) }}

@endif @endif
@endif {{-- Historic tickets --}}
{{ __('Historic tickets') }} @if ($this->tickets->isEmpty())

{{ __('No tickets for this customer yet.') }}

@else @endif
@endif