@extends('frontend.layouts.app', ['title' => '']) @section('content')
@include('frontend.layouts.sidebar')
@if ($orders->isNotEmpty())
My Orders ({{ $orders->count() }})
@foreach ($orders as $order) {{-- @dd($order) --}}
Order ID: {{ $order->cart_id }}
@if ($order->shipment?->status == 'success')
Track
@endif @if ($order->order_status == 'Completed')
Reciept
@endif
{{ $order->payment_method }}
Delivery Address:
@if ($order->address)

{{ $order->address->name ?? '' }}

{{ $order->address->address_line1 ?? '' }} @if ($order->address->address_line2) , {{ $order->address->address_line2 }} @endif

{{ $order->address->city ?? '' }}, {{ $order->address->state ?? '' }} {{ $order->address->pincode ?? '' }}

@if ($order->address->phone)

Phone: {{ $order->address->phone }}

@endif @else

No address available

@endif
@if ($order->orderItems->isNotEmpty()) @php $total = 0; @endphp @foreach ($order->orderItems as $item) {{-- @dd($item->variation->product->slug) --}}
{{ $item->product_name }}
{{ $item->product_name }}
@php // dd($item->variation->product->tax->value ); $mrp = $item->variation->mrp; $price = $item->variation->price; if ($item->variation->product->tax) { $taxPrice = $price * ($item->variation->product->tax ->value / 100); $priceWithoutTax = $price - $taxPrice; } $percentOff = $mrp > 0 && $price > 0 && $mrp != $price ? round( (($mrp - $price) / $mrp) * 100, ) : 0; @endphp @if ($percentOff > 0) {{ $percentOff }}% off MRP ₹{{ $mrp }} @endif
@if ($item->variation->product->tax) {{ $priceWithoutTax }} + {{ $taxPrice }} {{ $item->variation->product->tax->value }} % {{ $item->variation->product->tax->name }} = ₹{{ $price }} @else ₹{{ $price }} @endif
@if ($item->variation->variation_attributes->isNotEmpty())
{{ $item->variation->variation_attributes->map(function ($attribute) { return $attribute->attribute->attribute->name . ': ' . $attribute->attribute->name; })->implode(', ') }}
@endif
Qty: {{ $item->quantity }}
@php $total += $item->variation->price * $item->quantity; @endphp @endforeach @endif
@if ($order->orderItems->isNotEmpty())
Status: {{ $order->order_status }}
Order Date: {{ $order->order_date }}
Payment Status: {{ $order->payment_status }}
Order Date: {{ $order->order_date }}
Sub Total: ₹{{ $total }}
Applied Coupon: -₹{{ $order->coupon_discount }} @if ($order->coupon) ({{ $order->coupon->coupon_name ?? '' }}) @endif
Total: ₹{{ $order->total_price }}
@endif
@endforeach
{{ $orders->links() }} {{-- --}} @else

No Orders Found

You haven't placed any orders yet. Start shopping to see your orders here!

@endif
@push('scripts') {!! JsValidator::formRequest('App\Http\Requests\Frontend\Profile\ProfileUpdateRequest', '#profile-update-form') !!} @endpush @endsection