@extends('layouts.app') @section('title', 'TemTechnik | ' . __('general.page_title_cart')) @section('content')

{{ __('general.shopping_cart') }}

@if(isset($cartItems) && count($cartItems) === 0)

{{ __('general.your_cart_is_empty') }}

{{ __('general.cart_empty_page_message') }}

{{ __('general.continue_shopping') }}
@if(!empty($suggestedProducts))

{{ __('general.new_arrivals') }}

@foreach($suggestedProducts as $product) @endforeach
@endif @else
@foreach($cartItems as $item)
{{ $item['product']->name }}

{{ $item['product']->name }}

@php $currency = session('currency', 'AZN'); $price = $item['product']->getPriceInCurrency($currency); $finalPrice = $item['product']->getFinalPriceInCurrency($currency); $symbol = $item['product']->getCurrencySymbol($currency); @endphp
@if($item['product']->isDiscounted()) {{ $symbol }}{{ number_format($price, 2) }} {{ $symbol }}{{ number_format($finalPrice, 2) }} @else {{ $symbol }}{{ number_format($price, 2) }} @endif
@csrf
@csrf
{{ __('general.subtotal') }}: {{ $symbol }}{{ number_format($item['subtotal'], 2) }}
@endforeach
@php $currency = session('currency', 'AZN'); $symbol = get_currency_symbol($currency); $originalTotal = 0; foreach ($cartItems as $item) { $originalTotal += $item['product']->getPriceInCurrency($currency) * $item['quantity']; } $discountAmount = $originalTotal - $total; @endphp

{{ __('general.order_summary') }}

{{ __('general.original_total') ?? 'Original total' }}
{{ $symbol }}{{ number_format($originalTotal, 2) }}
{{ __('general.discount_amount') ?? 'Discount' }}
-{{ $symbol }}{{ number_format($discountAmount, 2) }}
{{ __('general.order_total') }}
{{ $symbol }}{{ number_format($total, 2) }}

{{ __('general.or') }} {{ __('general.continue_shopping') }}

@endif
@if(isset($recentProducts) && count($recentProducts) > 0)

{{ __('general.recently_added') }}

@foreach($recentProducts->take(4) as $product) @endforeach
@endif @endsection @push('scripts') @endpush