@section('metaTitle', 'Customer Profile - Punjabi Mandi') @section('body_id', 'profile-page-body') @section('body_class', 'lang-en country-ca currency-cad layout-full-width page-customer-account') @section('wrapper_class', 'pm-profile-page-wrapper') @push('styles') @endpush @section('breadcrumb')
  1. Home
  2. Customer Profile
@endsection @php $fullName = trim(($customer->first_name ?? '') . ' ' . ($customer->last_name ?? '')); if (empty($fullName)) { $fullName = 'Valued Customer'; } $avatarUrl = 'https://ui-avatars.com/api/?name=' . urlencode($fullName) . '&background=E8F5E9&color=2E7D32&rounded=true&bold=true'; $memberSince = $customer->created_at ? $customer->created_at->format('M Y') : 'Oct 2024'; $pendingOrdersCount = $orders->filter(function($o) { return !in_array(strtolower($o->status ?? ''), ['completed', 'delivered']); })->count(); $deliveredOrdersCount = $orders->filter(function($o) { return in_array(strtolower($o->status ?? ''), ['completed', 'delivered']); })->count(); @endphp
{{ $fullName }}

{{ $fullName }} Verified Customer

{{ $customer->email }} @if(!empty($customer->phone)) {{ $customer->phone }} @endif Member since {{ $memberSince }}
{{ count($orders) }} Orders
{{ count($wishlists) }} Wishlist
$ {{ number_format($totalPaid, 2) }} Paid Amount

Need Assistance?

Our Mandi customer happiness team is available 7 days a week to help with your grocery orders.

437-256-6099 info@punjabimandi.com

Hello, {{ $customer->first_name ?: 'there' }}! 👋

Welcome to your personal Punjabi Mandi dashboard. Manage fresh deliveries, wishlist, and profile details here.

Shop Fresh Today

{{ count($orders) }} Orders

{{ $latestOrder ? ('Latest: #' . ($latestOrder->order_no ?? ('PM-' . (1000 + $latestOrder->id)))) : 'No orders yet' }}

{{ count($wishlists) }} Items

Saved In Wishlist

$ {{ number_format($totalPaid, 2) }}

Total Amount Paid

@if($latestOrder) @php $latestOrderNo = $latestOrder->order_no ?? ('PM-' . (1000 + $latestOrder->id)); $latestStatus = strtolower($latestOrder->status ?? 'pending'); $isPickup = strtolower($latestOrder->delivery_type ?? '') === 'pickup'; $isDelivered = in_array($latestStatus, ['completed', 'delivered']); $isOnTheWay = in_array($latestStatus, ['shipped', 'ready to pickup', 'on the way']); $isPacked = in_array($latestStatus, ['packed', 'processing']); $badgeClass = 'pm-status-transit'; $badgeIcon = ''; if ($isDelivered) { $badgeClass = 'pm-status-delivered'; $badgeIcon = ''; } elseif ($isOnTheWay) { $badgeClass = 'pm-status-shipped'; $badgeIcon = $isPickup ? '' : ''; } elseif ($isPacked) { $badgeClass = 'pm-status-packed'; $badgeIcon = ''; } elseif (in_array($latestStatus, ['cancelled', 'refunded'])) { $badgeClass = 'pm-status-cancelled'; $badgeIcon = ''; } @endphp

{!! $isPickup ? '' : '' !!} Latest Order: #{{ $latestOrderNo }}

{!! $badgeIcon !!} {{ ucfirst($latestOrder->status ?? 'Confirmed') }}

{{ $isPickup ? 'Pickup' : 'Estimated Delivery' }}: {{ $latestOrder->date ? \Carbon\Carbon::parse($latestOrder->date)->format('D, M d') : 'Standard Delivery' }} {{ $latestOrder->time }} • {{ count($latestOrder->items ?? []) }} {{ Str::plural('Item', count($latestOrder->items ?? [])) }} ($ {{ number_format($latestOrder->grand_total, 2) }})

Placed
{!! ($isPacked || $isOnTheWay || $isDelivered) ? '' : '' !!}
Packed
{!! $isDelivered ? '' : ($isPickup ? '' : '') !!}
{{ $isPickup ? 'Ready for Pickup' : 'Shipped' }}
{!! $isDelivered ? '' : '' !!}
{{ $isPickup ? 'Picked Up' : 'Delivered' }}
@endif

Quick Profile Actions

Personal Details & Password

Keep your contact details up to date for smooth grocery deliveries.

My account details

@csrf

Password

@csrf

Your Orders & Delivery History

Showing {{ count($orders) }} {{ Str::plural('order', count($orders)) }} placed with Punjabi Mandi
Need an invoice? Click View Invoice on any order below.
@if(count($orders) > 0) @foreach($orders as $ord) @php $ordNo = $ord->order_no ?? ('PM-' . (1000 + $ord->id)); $st = strtolower($ord->status ?? 'pending'); $isPick = strtolower($ord->delivery_type ?? '') === 'pickup'; $isDel = in_array($st, ['completed', 'delivered']); $isShip = in_array($st, ['shipped', 'ready to pickup', 'on the way']); $isPkd = in_array($st, ['packed', 'processing']); $cat = $isDel ? 'delivered' : 'transit'; $badgeCls = 'pm-status-transit'; $badgeIco = ''; if ($isDel) { $badgeCls = 'pm-status-delivered'; $badgeIco = ''; } elseif ($isShip) { $badgeCls = 'pm-status-shipped'; $badgeIco = $isPick ? '' : ''; } elseif ($isPkd) { $badgeCls = 'pm-status-packed'; $badgeIco = ''; } elseif (in_array($st, ['cancelled', 'refunded'])) { $badgeCls = 'pm-status-cancelled'; $badgeIco = ''; } @endphp
Order Number #{{ $ordNo }}
Date Placed {{ $ord->created_at ? $ord->created_at->format('M d, Y') : '' }}
Total Amount $ {{ number_format($ord->grand_total, 2) }}
Delivery Type {{ ucfirst($ord->delivery_type ?? 'delivery') }}
{!! $badgeIco !!} {{ ucfirst($ord->status ?? 'Confirmed') }}
@if($ord->items && count($ord->items) > 0)
@foreach($ord->items as $it) @php $pThumb = null; if ($it->product) { if (!empty($it->product->thumbnail)) { $pThumb = asset('storage/' . $it->product->thumbnail); } elseif ($it->product->images && $it->product->images->first()) { $pThumb = $it->product->images->first()->image_url; } } if (!$pThumb) { $pThumb = asset('frontend/assets/images/default.jpg'); } @endphp
{{ $it->name }}

{{ $it->name }}

Qty: {{ $it->quantity }} @if($it->sku) • SKU: {{ $it->sku }} @endif

$ {{ number_format($it->total_amount, 2) }}
@endforeach
@endif
@endforeach @else

No Orders Yet

You haven't placed any orders yet. Discover our fresh groceries and enjoy next-day delivery!

Start Shopping
@endif

My Grocery Wishlist {{ count($wishlists) }} Items Saved

Your Wishlist is Empty

Explore our fresh grocery collections and save your favorite organic items for later!

Discover Products
@foreach($wishlists as $wish) @php $prod = $wish->product; if (!$prod) continue; $wThumb = null; if (!empty($prod->thumbnail)) { $wThumb = asset('storage/' . $prod->thumbnail); } elseif ($prod->images && $prod->images->first()) { $wThumb = $prod->images->first()->image_url; } if (!$wThumb) { $wThumb = asset('frontend/assets/images/default.jpg'); } @endphp
@if($prod->is_featured || $prod->is_best_seller) Top Pick @endif @php $prodUrl = $prod->url_key ? route('productByCategory', $prod->url_key) : '#'; $inStock = ($prod->inventory?->inventory ?? 0) > 0 && $prod->in_stock; @endphp {{ $prod->name }}
{{ (!empty($prod->brand_name?->name) && trim($prod->brand_name->name) !== '-') ? $prod->brand_name->name : '-' }}

{{ $prod->name }}

$ {{ number_format($prod->special_price ?: $prod->price, 2) }} @if($prod->special_price && $prod->special_price < $prod->price) $ {{ number_format($prod->price, 2) }} @endif @if($inStock) In Stock @else Out of Stock @endif
@if($inStock) @else @endif
@endforeach

Confirm Sign Out

Are you sure you want to log out, {{ $customer->first_name }}?

You will need to enter your email and password to access your account details and order status again.

Order Receipt - #Order

Live Delivery Tracking - #Order

Cancel Order

Cancel Order #Order?

Are you sure you want to cancel this order? Once cancelled, items will be restocked and you will need to place a new order if you change your mind.

Total: $0.00 Date
Changes saved successfully!
@php $storeAddress = \App\Models\HomeSetting::first()?->address ?? '1155 North Service Road West, Oakville, ON L6M 3E3'; // Prepare dictionary of order details for instantaneous modal display without AJAX latency $ordersPayload = []; foreach ($orders as $o) { $oNum = $o->order_no ?? ('PM-' . (1000 + $o->id)); $itemsArr = []; if ($o->items) { foreach ($o->items as $it) { $itemsArr[] = [ 'name' => $it->name, 'qty' => $it->quantity, 'price' => '$ ' . number_format($it->total_amount, 2), ]; } } $shipToName = $o->first_name . ' ' . $o->last_name; $addrLine = $o->address->address ?? ''; $cityState = ($o->address->city ?? '') . ($o->address && $o->address->state ? ', ' . $o->address->state : '') . ($o->address && $o->address->pincode ? ' ' . $o->address->pincode : ''); $fullAddress = trim($addrLine . ($cityState ? ', ' . $cityState : '')); if (empty($fullAddress)) { $fullAddress = '1155 North Service Road West, Oakville, ON L6M 3E3'; } $discountVal = abs((float)($o->discount_amount ?? 0)); $couponDiscountStr = ($discountVal > 0) ? '-$' . number_format($discountVal, 2) : '$0.00'; $shippingChargeStr = '$' . number_format((float)($o->delivery_charge ?? 0), 2); $taxRateStr = ($o->tax !== null && $o->tax !== '') ? (string)$o->tax : '0'; $taxTotalStr = '$' . number_format((float)($o->tax_total ?? 0), 2); $taxableSubTotalStr = '$' . number_format((float)($o->total_amount ?? 0), 2); $ordersPayload[$o->id] = [ 'id' => $o->id, 'order_no' => $oNum, 'date' => $o->created_at ? $o->created_at->format('M d, Y') : '', 'status' => ucfirst($o->status ?? 'Confirmed'), 'raw_status' => strtolower($o->status ?? 'pending'), 'delivery_type' => ucfirst($o->delivery_type ?? 'Delivery'), 'is_pickup' => strtolower($o->delivery_type ?? '') === 'pickup', 'shipment_name' => $o->shipment_name ?? '', 'tracking_id' => $o->tracking_id ?? '', 'slot' => ($o->date ? \Carbon\Carbon::parse($o->date)->format('D, M d') : 'Standard Delivery') . ' ' . ($o->time ?? ''), 'customer_name' => $shipToName, 'address' => $fullAddress, 'store_address' => $storeAddress, 'phone' => $o->phone ?: ($customer->phone ?: 'N/A'), 'items' => $itemsArr, 'subtotal' => '$ ' . number_format($o->total_amount, 2), 'taxable_item' => $taxableSubTotalStr, 'coupon_discount' => $couponDiscountStr, 'tax_rate' => $taxRateStr, 'tax' => $taxTotalStr, 'shipping' => $shippingChargeStr, 'total' => '$ ' . number_format($o->grand_total, 2), ]; } @endphp @push('scripts') @endpush