@if (Session::has('flash_success'))
@if ($user)
@php
$orders = \App\Models\Order::with(['orderItems.product', 'orderItems.vendorProduct'])
->where('user_id', $user->id)
->orderBy('created_at', 'desc')
->get();
@endphp
@else
@php
$wishlistItems = \App\Models\Wishlist::with('product')
->where('user_id', $user->id)
->latest()
->get();
@endphp
@else
@endif
@php
$myReviews = \App\Models\Review::with('product')
->where('user_id', $user->id)
->get();
@endphp
@else
@else
{{ Session::get('flash_success') }}
@endif
@if (Session::has('flash_error'))
{{ Session::get('flash_error') }}
@endif
My Profile
| First Name | {{ $user->first_name }} |
|---|---|
| {{ $user->email }} | |
| Phone Number | {{ $user->phone }} |
My Orders
@if ($orders->count())| # | Order ID | Status | Total Paid (₹) | Invoice |
|---|---|---|---|---|
| {{ $k + 1 }} | {{ $order->order_number ?? $order->id }} | @php // Improved order status badge mapping $orderStatus = $order->order_status ?? (($order->payment_status ?? '') === 'paid' ? 'processing' : 'pending'); $normalizedStatus = strtolower($orderStatus); $orderStatusConfig = [ // status => [iconClass, label override/translate, badge css class] 'delivered' => ['fa-truck','Delivered', 'order-status-badge order-status-delivered'], 'completed' => ['fa-check-circle','Completed','order-status-badge order-status-completed'], 'processing' => ['fa-sync-alt','Processing','order-status-badge order-status-processing'], 'pending' => ['fa-clock','Pending','order-status-badge order-status-pending'], 'confirmed' => ['fa-clipboard-check','Confirmed','order-status-badge order-status-confirmed'], 'shipped' => ['fa-shipping-fast','Shipped','order-status-badge order-status-shipped'], 'out_for_delivery' => ['fa-truck-loading','Out for Delivery','order-status-badge order-status-out_for_delivery'], 'cancelled' => ['fa-ban','Cancelled','order-status-badge order-status-cancelled'], 'canceled' => ['fa-ban','Cancelled','order-status-badge order-status-canceled'], 'failed' => ['fa-times-circle','Failed','order-status-badge order-status-failed'], 'refunded' => ['fa-undo','Refunded','order-status-badge order-status-refunded'], 'success' => ['fa-check-circle','Success','order-status-badge order-status-success'], ]; $icon = 'fa-circle'; $orderStatusLabel = ucfirst(str_replace('_', ' ', $normalizedStatus)); $badgeClass = 'order-status-badge order-status-default'; // Try mapping if(array_key_exists($normalizedStatus, $orderStatusConfig)){ [$icon, $label, $badgeClass] = $orderStatusConfig[$normalizedStatus]; $orderStatusLabel = $label; } @endphp{{ $orderStatusLabel }} | ₹{{ number_format($order->total_amount ?? 0, 2) }} | Generate Invoice |
You have not placed any orders yet.
@endif
My Wishlist
@if ($wishlistItems->count() > 0)| # | Product | Price | Added On |
|---|---|---|---|
| {{ $key + 1 }} | @if ($item->product) {{ $item->product->product_name }} @else Product Unavailable @endif | @if ($item->product && isset($item->product->sp)) @php $accountSp = $item->product->sp ?? 0; $accountGst = $item->product->gst ?? 0; $accountPriceWithGst = $accountSp + ($accountSp * $accountGst / 100); @endphp ₹{{ number_format($accountPriceWithGst, 2) }} ({{ $accountGst }}% GST) @elseif ($item->product && isset($item->product->price)) @php $accountSp = $item->product->price ?? 0; $accountGst = $item->product->gst ?? 0; $accountPriceWithGst = $accountSp + ($accountSp * $accountGst / 100); @endphp ₹{{ number_format($accountPriceWithGst, 2) }} ({{ $accountGst }}% GST) @else N/A @endif | {{ \Carbon\Carbon::parse($item->created_at)->format('d M Y h:ia') }} |
Your wishlist is empty.
@endif
Change Password
{{-- Success Message --}} @if (session('success'))
{{ session('success') }}
@endif
@if ($errors->any())
-
@foreach ($errors->all() as $error)
- {{ $error }} @endforeach
My Reviews
@if ($myReviews->count() > 0)| # | Product | Rating | Message | Date |
|---|---|---|---|---|
| {{ $key + 1 }} | @if ($review->product) {{ $review->product->product_name }} @else N/A @endif | {{-- Star ratings --}} @php $rating = (int) $review->rating; @endphp @for ($i = 1; $i <= 5; $i++) @if ($i <= $rating) @else @endif @endfor ({{ $review->rating }}) | {{ $review->message }} | {{ \Carbon\Carbon::parse($review->created_at)->format('d M Y') }} |
You have not submitted any reviews yet.
@endif
Manage Address
@php $addresses = \App\Models\Address::where('user_id', $user->id) ->latest() ->get(); @endphp {{-- Show success message if address is added --}} @if (session('flash_success'))
{{ session('flash_success') }}
@endif
@if ($addresses && $addresses->count() > 0)
| # | Name | Phone | Address | Pin Code | City | State | Type | Actions |
|---|---|---|---|---|---|---|---|---|
| {{ $key + 1 }} | {{ $address->name }} | {{ $address->phone }} | {{ $address->address }} | {{ $address->pincode }} | {{ $address->city }} | {{ $address->state }} | {{ ucfirst($address->address_type ?? 'N/A') }} |
|
No addresses found.
@endif