@extends('front.master') @section('title', 'Cart') @push('styles') @endpush @section('content')
Continue shopping

You have {{ count($carts) }} items in your cart

@php $subTotal = 0; $discountTotal = 0; $cartCount = count($carts); @endphp @foreach ($carts as $item) @php $course = $item->course; $price = $item->price(); $duration = $item->duration(); $subTotal += $price; @endphp
{{ $course->title }}
{{ $course->title }}

{{ $duration }} month(s) | {{ number_format($item->realPrice(), 2) }}

{{ number_format($price, 2) }} AED

@endforeach
Payment Details
Avatar

Subtotal

{{ number_format($subTotal, 2) }} AED

Discount

@php $discount =0; @endphp @if ($cartCount >= 5) @php $discount = 10; @endphp @elseif ($cartCount >= 3 && $cartCount <= 4) @php $discount = 5; @endphp @endif

{{$discount}} %

VAT

5 %

Total(Incl. taxes)

@php $amount = floatval( number_format($subTotal - $discountTotal, 2, '.', ''), ); $taxAmount = ($amount * 5) / 100; $finalAmount = $amount + $taxAmount; if ($cartCount >= 5) { $finalAmount -= $finalAmount * 0.1; // 10% discount } elseif ($cartCount >= 3 && $cartCount <= 4) { $finalAmount -= $finalAmount * 0.05; // 5% discount } @endphp

{{ $finalAmount ?? 0 }} AED

@if (count($carts)) @endif
@endsection @push('custom-scripts') @endpush