@extends('reseller.layouts.app') @section('title', 'আমার অর্ডারসমূহ') @push('styles') @endpush @section('content')
আমার অর্ডারসমূহ
মোট অর্ডার: {{ $orders->total() }} টি
@forelse($orders as $order)
অর্ডার আইডি #{{ $order->invoice_id ?? $order->id }}
|
তারিখ {{ $order->created_at->format('d M, Y h:i A') }}
@php $statusClass = 'badge-pending'; if ($order->order_status == 6) $statusClass = 'badge-completed'; // Delivered elseif ($order->order_status == 5) $statusClass = 'badge-confirmed'; // Processing elseif ($order->order_status == 11) $statusClass = 'badge-cancelled'; // Cancelled @endphp {{ $order->status->name ?? 'Pending' }}
{{ substr($order->customer->name ?? 'G', 0, 1) }}
{{ $order->customer->name ?? 'Guest Customer' }}

{{ $order->customer->phone ?? 'N/A' }}

@if($order->shipping && $order->shipping->address) {{ Str::limit($order->shipping->address, 50) }} @else N/A @endif

@if($order->orderdetails && $order->orderdetails->count() > 0)
@foreach($order->orderdetails->take(3) as $detail) @php $productSlug = null; if ($detail->product && $detail->product->slug) { $productSlug = $detail->product->slug; } $productImage = null; // First try to get image from product relationship if ($detail->product && $detail->product->image) { $productImage = $detail->product->image->image; } // Fallback: try to get from orderdetails image relationship elseif ($detail->image) { $productImage = $detail->image->image; } @endphp
@if($productImage) @if($productSlug) {{ $detail->product_name }} @else {{ $detail->product_name }} @endif @else
@endif
@if($productSlug) {{ Str::limit($detail->product_name, 22) }} @else {{ Str::limit($detail->product_name, 22) }} @endif x {{ $detail->qty }}
৳{{ number_format($detail->sale_price * $detail->qty) }}
@endforeach @if($order->orderdetails->count() > 3)
+ আরও {{ $order->orderdetails->count() - 3 }} টি পণ্য
@endif
@else
কোন পণ্যের তথ্য পাওয়া যায়নি
@endif
কাস্টমার পেমেন্ট
৳{{ number_format($order->customer_payable_amount ?? 0) }}
লাভ: ৳{{ number_format($order->reseller_profit ?? 0) }}
@empty
No Orders
কোন অর্ডার পাওয়া যায়নি

আপনি এখনও কোনো অর্ডার প্লেস করেননি।

নতুন অর্ডার করুন
@endforelse
@if($orders->hasPages())
{{-- Previous Button --}} @if ($orders->onFirstPage()) @else @endif {{-- Page Numbers --}} @foreach(range(1, $orders->lastPage()) as $i) @if($i >= $orders->currentPage() - 2 && $i <= $orders->currentPage() + 2) @if ($i == $orders->currentPage()) {{ $i }} @else {{ $i }} @endif @endif @endforeach {{-- Next Button --}} @if ($orders->hasMorePages()) @else @endif
@endif @endsection @push('scripts') @endpush