@extends('web.home.layout.master') @section('content') @php $orderData = App\Models\Order::where('id', $id)->first(); $subTotal = $orderData->total ?? 0; $taxAmount = $orderData->tax_amount ?? 0; $serviceFee = $orderData->service_fee ?? 0; $discountAmount = $orderData->discount_amount ?? 0; $grandTotal = $subTotal + $taxAmount + $serviceFee - $discountAmount; // Progress Calculation $activeCount = 1; if ($orderData->processing == 1) { if ($orderData->ready == 1) { $activeCount = 2; if ($orderData->picked == 1) { $activeCount = 3; if ($orderData->on_the_way == 1) { $activeCount = 4; if ($orderData->delivered == 1) { $activeCount = 5; } } } } } else { $activeCount = 0; } $progressWidth = $activeCount > 0 ? (($activeCount - 1) * 25) : 0; @endphp
My Profile / Order Tracking

Order Status Details

Order ID #{{ $orderData->order_id }}
@if ($orderData->processing == 0 && $orderData->cancellation == 1)
This order has been cancelled.
@elseif ($orderData->processing == 0 && $orderData->cancellation == 0)
Cancellation has been requested for this order.
@endif
Ordered At

{{ \Carbon\Carbon::parse($orderData->created_at)->format('M j, Y') }}

Shipping By

American Plastics

Order Status

@if ($orderData->processing == 1 && $orderData->ready == 0 && $orderData->picked == 0 && $orderData->on_the_way == 0 && $orderData->delivered == 0) Processing @elseif ($orderData->processing == 1 && $orderData->ready == 1 && $orderData->picked == 0 && $orderData->on_the_way == 0 && $orderData->delivered == 0) Ready for pickup @elseif ($orderData->processing == 1 && $orderData->ready == 1 && $orderData->picked == 1 && $orderData->on_the_way == 0 && $orderData->delivered == 0) Shipped @elseif ($orderData->processing == 1 && $orderData->ready == 1 && $orderData->picked == 1 && $orderData->on_the_way == 1 && $orderData->delivered == 0) On the way @elseif ($orderData->processing == 1 && $orderData->ready == 1 && $orderData->picked == 1 && $orderData->on_the_way == 1 && $orderData->delivered == 1) Delivered @elseif ($orderData->processing == 0 && $orderData->cancellation == 1) Cancelled @elseif ($orderData->processing == 0 && $orderData->ready == 0 && $orderData->picked == 0 && $orderData->on_the_way == 0 && $orderData->delivered == 0) Cancellation in progress @endif

Tracking Number

{{ $orderData->tracking ?? 'No tracking updated!' }}

Order Confirmed
Ready for Pickup
Picked by Courier
On the Way
Delivered
@php $productData = DB::table('product') ->join('product_color', 'product.id', '=', 'product_color.product_id') ->select( 'product.id', 'product.product_name', 'product_color.color_image' ) ->where('product.id', $orderData->product_id) ->where('product_color.product_color', $orderData->color) ->first(); $color_code = $orderData->color; // Map code to color name $colorMapping = [ '#A78B8D' => 'Marblepink', '#61A8F8' => 'Babyblue', '#C55C82' => 'Pink', '#FF0000' => 'Red', '#CAD3D0' => 'Clear', '#BA9978' => 'Beige', '#88DB86' => 'Applegreen', '#DEE4EE' => 'Marblewhite', '#BDB8EE' => 'Marbleviolet', '#E9CBB9' => 'Marbleorange', '#FEF250' => 'Lemonyellow', '#f4c2c2' => 'Babypink', '#D2C77D' => 'Metallicgold', '#DAD9C6' => 'Buttermilk', '#E9C500' => 'Yellow', '#D3CBC4' => 'Graybeige', '#0F2D8D' => 'Blue', '#005E3A' => 'Green', '#D6F2E6' => 'Marblegreen', '#BF8BFF' => 'Violet', '#6B4B36' => 'Brown', '#C0C0C0' => 'Silver', '#808080' => 'Grey', '#6CD2FA' => 'Skyblue', '#D09305' => 'Orange', '#13598B' => 'Metallicblue', '#9582BB' => 'Metallicviolet', '#A286F4' => 'Purple', '#62ADE6' => 'Marbleblue', '#80355C' => 'Marblered', '#2FCBD4' => 'Avocadogreen', '#FFA07A' => 'Lightorange', '#DDD3D1' => 'Marblebeige', '#F4C430' => 'Saffron', '#000000' => 'Black', '#D4AF37' => 'Marblegold', '#FFFFFF' => 'Purewhite', '#B4B4B8' => 'Metallicsilver', '#58C3C2' => 'Marblegreen', '#006A4E' => 'Bottlegreen', '#6F4E37' => 'Coffee', '#FFFDD0' => 'Cream', '#A9A9A9' => 'Darkgrey', '#C40233' => 'Metalicred', '#3D7764' => 'Metalicgreen', '#F8B700' => 'Metalicyellow' ]; $colorName = $colorMapping[strtoupper($color_code)] ?? $colorMapping[$color_code] ?? 'Default Color'; @endphp

Items in Order

@if($productData && $productData->color_image) {{ $productData->product_name ?? 'Product' }} @else Default Product @endif

{{ $productData->product_name ?? 'Product Name' }}

Qty: {{ $orderData->quantity }} Color: {{ $colorName }}
Shipping Address

{{ $orderData->address_1 }}, {{ $orderData->address_2 }}, {{ $orderData->city }}

Payment Summary

Subtotal LKR {{ number_format($subTotal, 2) }}
@if($taxAmount > 0)
Tax ({{ $orderData->tax_percentage }}%) LKR {{ number_format($taxAmount, 2) }}
@endif
Shipping Fee LKR {{ number_format($serviceFee, 2) }}
@if($discountAmount > 0)
Discount - LKR {{ number_format($discountAmount, 2) }}
@endif
Total Paid LKR {{ number_format($grandTotal, 2) }}
@endsection