@extends('layouts.customer') @section('title') My Orders @endsection @section('content')
@if(session('status')) @endif

My Orders

COMPLETED ORDERS
@foreach ($orders as $item) @if (Auth::id() === $item->user->id) @if(request('status') === null || in_array($item->status, explode(',', request('status')))) @php if (!function_exists('getDeliveryFee')) { function getDeliveryFee($shopId) { $deliveryRate = \App\Models\DeliveryRate:: where('is_active', 1) ->value('delivery_fee'); return $deliveryRate ? $deliveryRate : 0; } } @endphp
Tracking Number Total Price Status Rider Date Action
{{ $item->tracking_no }}₱{{ number_format( $item->orderItems->sum(function ($orderItem) { $productPrice = $orderItem->product->productPrices() ->where('is_active', 1) ->where('created_at', '<', $orderItem->created_at) ->orderBy('created_at', 'desc') ->value('price'); return $productPrice ? $productPrice * $orderItem->qty : 0; }) + ($item->delivery_option == 2 ? getDeliveryFee($item->shop_id) : 0), 2, '.', ',' ) }} @if ($item->status == '0') Pending @elseif ($item->status == '1') Approved Order @elseif ($item->status == '2') Order Packed @elseif ($item->status == '3') Ready for Delivery @elseif ($item->status == '4') Assigned to a rider @elseif ($item->status == '5') Picked up @elseif ($item->status == '6') Order is on the way @elseif ($item->status == '7') Order Done @elseif ($item->status == '8') Order Recieved @elseif ($item->status == '11') Cancelled Order @endif @if ($item->delivery_option == 2)
Fatal error: Uncaught Error: Class "App\Models\User" not found in D:\InetPub\vhosts\cmu-online.tech\janndhellemarthzulueta.cmu-online.tech\CLICKSHOP\resources\views\frontend\orders\index.blade.php:149 Stack trace: #0 {main} thrown in D:\InetPub\vhosts\cmu-online.tech\janndhellemarthzulueta.cmu-online.tech\CLICKSHOP\resources\views\frontend\orders\index.blade.php on line 149