@extends('site.layout.layout') @section('title',__('Shopping Cart')) @section('content')

{{ __('Shopping Cart') }}

@if($stores->count() > 1)

{{ __('You have added products from different merchants. Shipping fees will be added to each merchant separately.') }}*

@endif
@if($stores->count() > 0)
@foreach ($stores as $store)
{{ $store->getTranslation('title', app()->getLocale()) }}
@foreach ($store->products as $product) @php $cart = $product->carts()->where('user_id', auth()->id())->first(); @endphp @if ($cart)
{{ __('Store Title') }}: {{ $store->getTranslation('title', app()->getLocale()) }}
{{ $product->getTranslation('description', app()->getLocale()) }}

{{ number_format($product->product_net_price, 2) }}

@csrf @method('PUT')

{{ number_format($cart->total, 2) }}

@csrf @method('DELETE')
@endif @endforeach
@endforeach

{{ __('Order summary') }}

@foreach ($stores as $store) @php $storeCarts = $store->products->flatMap(function ($product) { return $product->carts->where('user_id', auth()->id()); }); $subtotal = $storeCarts->sum('total'); $vat = $subtotal * 0.15; @endphp

{{ __('Store Title') }}: {{ $store->getTranslation('title', app()->getLocale()) }}

{{ __('Total products') }}
{{ number_format($subtotal, 2) }}
{{ __('VAT') }} (15%)
{{ number_format($vat, 2) }}
@endforeach
@php $final_subtotal = auth()->user()->carts()->sum('total'); $final_vat = $final_subtotal * 0.15; @endphp

{{ __('Total') }}

{{ number_format($final_subtotal + $final_vat, 2) }}

{{ __('Prices include tax') }}*

{{ __('Complete the order') }}
@else {{ __('Your shopping cart is empty!Continue shopping') }} @endif
@endsection @push('scripts') @endpush