@extends('layouts.app') @section('content')

{{ __('shop.cart_title') }}

@if ($cart->isEmpty())

{{ __('shop.cart_empty') }}

{{ __('shop.cart_empty_message') }}

@else

{{ __('shop.cart_title') }}

{{ $cartCount }} {{ __('shop.cart_items') }}
@csrf
@foreach ($cart as $id => $item)
{{ $item['name'] }}
{{ $item['name'] }}

{{ $item['quantity'] }}
{{-- price --}}
@php $price = $item['price'] ?? 0; $quantity = $item['quantity'] ?? 1; $discount = $item['discount'] ?? 0; $discountType = $item['discount_type'] ?? null; $effectivePrice = $price; if ($discountType === 'fixed' && $discount > 0) { $effectivePrice = max(0, $price - $discount); } elseif ($discountType === 'percentage' && $discount > 0) { $effectivePrice = max(0, $price * (1 - ($discount / 100))); } $lineTotal = $effectivePrice * $quantity; @endphp @if($effectivePrice < $price) {{ number_format(($price * $quantity), 2, ',', ' ') }} @endif {{ number_format($lineTotal, 2) }}
@if (!$loop->last)

@endif @endforeach
{{-- Coupon --}}
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
@csrf
{{ __('shop.cart_summary') }}
{{ __('shop.cart_subtotal') }} {{ $subtotal }}
@if ($discountAmount > 0) {{-- come from ViewServiceProvider --}}
{{ __('shop.cart_discount_label') }} ({{ $couponCode }}) {{ number_format($discountAmount, 2, ',', ' ') }}
@endif
{{ __('shop.cart_tva_label') }} ({{ $tvaRate * 100 }}%) 0
Total {{ $totalafterdiscountandtva }}
{{ __('shop.cart_do_order') }}

{{ __('shop.cart_free_shipping', ['amount' => $shippingfree_amount]) }}

@endif @endsection @section('scripts') @endsection