@extends('admin.layouts.main') @php $page_name = 'Product Information'; $cdr_pdfs = collect($order->checkoutProducts->toArray())->pluck('cdr_pdf', 'id'); $imagess = collect($order->checkoutProducts->toArray())->pluck('images', 'id'); $user_texts = collect($order->checkoutProducts->toArray())->pluck('user_text', 'id'); $previews = collect($order->checkoutProducts->toArray())->pluck('preview', 'id'); $og_images = collect($order->checkoutProducts->toArray())->pluck('og_images', 'id'); @endphp @section('content')
{{-- Header: Order ID + Status + Buttons --}}
@if ($order->courier_id == '')
Note: This order need to shipped manually.
@endif
Order #{{ $order->payment_order_id }}
@if (isset($order->shiprocketOrder->active) && !$order->shiprocketOrder->active) Shipment Cancel @endif @if ($order->status == 'completed') under_process") }} text-dark mb-2"> {{ config("constant.under_process.$order->under_process") }} @elseif($order->status == 'pending') Payment {{ config("constant.under_process.$order->under_process") }} @endif

Placed on: {{ $order->created_at->format('d M Y, h:i A') }}

@if (!$order->under_process)
@csrf
@endif @if (in_array($order->under_process, [0,1]))
@endif @if (in_array($order->under_process,[2,3]))
@endif @if ($order->ready_to_delivery == 0 && $order->courier_id != '' && $order->under_process == 1)
@elseif($order->courier_id == '' && $order->under_process == 1) @php $maual_shipping = config('constant.shipping_status'); @endphp @endif
{{-- Address & User Info --}}
Customer Details

Name: {{ $order->user->name ?? '-' }}

Email: {{ $order->user->email ?? '-' }}

Mobile: {{ $order->user->mobile ?? '-' }}

GST: {{ $order->gst_number ?? '-' }}

Organization: {{ $order->org_name ?? '-' }}

Payment Type: {{ ucfirst($order->payment_type) }}

Wallet Used: ₹{{ number_format($order->wallet_amount, 2) }}

Paid Online: ₹{{ number_format($order->non_wallet_amount, 2) }}

Shipping Address
@if ($order->shippingAddress)

{{ $order->shippingAddress->name }}

{{ $order->shippingAddress->line1 }}, {{ $order->shippingAddress->line2 }}

{{ $order->shippingAddress->city }}, {{ $order->shippingAddress->district }}

{{ $order->shippingAddress->state }} - {{ $order->shippingAddress->pincode }}

{{ $order->shippingAddress->country }}

@else

No address provided.

@endif
Cancellation Reason
@if ($order->under_process == 2)
Order Cancelled by User
Reason: {{ $order->cancel_remark_by_user ?? 'No reason provided' }}
@elseif ($order->under_process == 3)
Order Cancelled by Admin
Refund will be processed within 15 to 20 business days.
@elseif ($order->under_process == 4)
Order Cancelled and Refunded
@if ($order->cancelled_by === 'admin') Cancelled by: Admin
Reason: {{ $order->cancelled_remark_by_admin ?? 'No reason provided' }} @elseif ($order->cancelled_by === 'user') Cancelled by: User
Reason: {{ $order->cancel_remark_by_user ?? 'No reason provided' }} @else Cancelled by: Unknown @endif @endif
{{-- Product Table --}}
Products in Order
@foreach ($order->checkoutProducts as $index => $product) @php $product_id = $product['id']; $images = []; $preview = []; $user_text_list = []; $cdr_pdf = []; $og_image = []; try { $images = json_decode($imagess[$product_id], true); } catch (\Throwable $th) { } try { $preview = json_decode($previews[$product_id] ?? '', true); } catch (\Throwable $th) { } try { $user_text_list = json_decode($user_texts[$product_id] ?? '', true) ?? []; } catch (\Throwable $th) { } try { $cdr_pdf = json_decode($cdr_pdfs[$product_id] ?? '', true); } catch (\Throwable $th) { } try { $og_image = json_decode($og_images[$product_id] ?? '', true); } catch (\Throwable $th) { } @endphp {{-- View Design Modal --}} @if ($preview || !empty($user_text_list) || !empty($images)) @elseif (!empty($cdr_pdf)) @elseif($order->microsite) @endif @endforeach
Image Name Qty MRP Price Discount Branding Shipping CGST SGST HSN Action
@if ($product->product_image) @endif {{ $product->product_name }} {{ $product->quantity }} ₹{{ number_format($product->mrp, 2) }} ₹{{ number_format($product->sales_price, 2) }} {{ $product->discount }}% ₹{{ number_format($product->branding_cost, 2) }} ₹{{ number_format($product->shipping_cost, 2) }} {{ $product->cgst }}% {{ $product->sgst }}% {{ $product->hsn_code }} @if ($preview || !empty($images) || !empty($user_text_list)) @elseif (!empty($cdr_pdf)) @elseif($order->microsite != '') @endif
@if ($order->ready_to_delivery == 0 && $order->courier_id != '' && $order->under_process == 1) @elseif($order->courier_id == '') @if (isset($maual_shipping[$order->manual_shipping_status + 1])) @endif {{-- @if (isset($maual_shipping[$order->manual_shipping_status - 1])) @endif --}} @endif
@endsection @push('script') @if ($order->ready_to_delivery == 0 && $order->courier_id != '' && $order->under_process == 1) @endif @endpush