@extends('frontEnd.layouts.master') @section('title','Order Details') @php $generalsetting = \App\Models\GeneralSetting::first(); @endphp @push('css') @endpush @section('content')
{{-- যদি কোনো অর্ডার না পাওয়া যায় --}} @if($order->count() == 0)
No Data

অর্ডার খুঁজে পাওয়া যায়নি

আপনার ইনভয়েস আইডি অথবা ফোন নম্বরটি সঠিক কিনা যাচাই করুন।

আবার চেষ্টা করুন
@else {{-- অর্ডার লুপ --}} @foreach($order as $value)
{{-- 1. Header --}}
Invoice #{{$value->invoice_id}}
Placed on: {{ date('d M, Y h:i A', strtotime($value->created_at)) }}
{{ optional(App\Models\Orderstatus::find($value->order_status))->name ?? 'Unknown' }}
{{-- 2. Info Grid --}}
Customer Details

{{ $value->shipping->name ?? 'Guest' }}

{{ $value->shipping->phone ?? $value->shipping_phone }}
Delivery Address

{{ $value->shipping->area ?? 'General' }}

{{ Str::limit($value->shipping->address ?? '', 35) }}
Payment Info

{{ $value->payment->payment_method ?? 'COD' }}

Status: {{ ucfirst($value->payment_status) }}
{{-- 3. Product List --}}
Order Items @php $orderdetails = App\Models\OrderDetails::where('order_id', $value->id)->get(); $subtotal = 0; @endphp @foreach($orderdetails as $product)
Product
{{ $product->product_name }}
@if($product->product_size) Size: {{ $product->product_size }} @endif @if($product->product_color) Color: {{ $product->product_color }} @endif
{{ number_format($product->sale_price * $product->qty, 0) }} ৳ {{ $product->sale_price }} x {{ $product->qty }}
@php $subtotal += ($product->sale_price * $product->qty); @endphp
@endforeach
{{-- 4. Summary & Total --}}
Subtotal {{ number_format($subtotal, 0) }} ৳
Delivery Charge (+) {{ number_format($value->shipping_charge, 0) }} ৳
@if($value->discount > 0)
Discount (-) {{ number_format($value->discount, 0) }} ৳
@endif
Grand Total {{ number_format($value->amount, 0) }} ৳
{{-- Print Button --}}
@endforeach @endif
@endsection