@extends('layouts.frontend.frontend_main') @section('title') @lang('frontend_lang.my_orders') @endsection @push('styles') @endpush @section('content')
@include('layouts.frontend.profile_sidebar')

@lang('frontend_lang.my_orders')

@forelse($orders as $order)
@lang('frontend_lang.order_number') : {{ $order->order_number }} @lang('frontend_lang.order_date') : {{ $order->created_at->translatedFormat(config('defaults.time_format')) }}
@foreach($order->items as $item) @php $sellingPrice = $item->price; $qty = (int) $item->qty; $totalQuantity += $qty; $discountPercentage = $order->customer_vat; $vatPercentage = $item->vat; $item->weight > 0 ? ($totalWeight += ($item->weight * $item->qty)) : null; $itemTotalAmount = $sellingPrice * $qty; $originalItemTotal += $itemTotalAmount; $discount = findDiscountAmount($itemTotalAmount, $discountPercentage); $totalDiscount += $discount; $afterDiscountItemTotal = ($itemTotalAmount - $discount); $totalVat += findVatAmount($afterDiscountItemTotal, $vatPercentage); @endphp
  • {{ $item->title }}

    @lang('frontend_lang.qty') : {{ $item->qty }}

    @lang('frontend_lang.price') : {{ $item->price }}

@endforeach

@lang('frontend_lang.sub_total') ({{ $totalQuantity }} items, {{ $totalWeight }} kg)

{{ showAmount($originalItemTotal) }}
@if($totalDiscount > 0)

@lang('frontend_lang.discount')

{{ showAmount($totalDiscount) }}
@endif @if($totalVat > 0)

@lang('frontend_lang.vat')

{{ showAmount($totalVat) }}
@endif

@lang('frontend_lang.net_total')

{{ showAmount(($originalItemTotal - $totalDiscount) + $totalVat) }}
@empty
@endforelse
{{ $orders->links() }}
@endsection @section('js') @endsection