@php $settings = app(\Korzilla\Core\Settings\SettingsRepository::class); $currency = $settings->string('catalog.currency_suffix', '₽'); $noPrice = $settings->string('catalog.no_price_label', 'Цена по запросу'); @endphp

Корзина

@if (session('error'))

{{ session('error') }}

@endif @if ($cart['unavailable'] !== []) {{-- Позиция могла быть снята с продажи, пока корзина ждала. Молча выбрасывать нельзя: человек должен понять, почему сумма изменилась. --}}

Больше не продаётся: {{ implode(', ', $cart['unavailable']) }}

@endif @if ($cart['items'] === [])

Корзина пуста.

Вернуться к покупкам @else @foreach ($cart['items'] as $line) @php($product = $line['product']) @php($photo = method_exists($product, 'firstMedia') ? $product->firstMedia('photo') : null) @php($url = $line['url'] ?? null) @endforeach
@if ($photo) {{ $product->name }} @endif @if ($url) {{ $product->name }} @else {{ $product->name }} @endif @if ($product->article) Артикул: {{ $product->article }} @endif @if ($line['price'] !== null) $line['discount_percent'] !== null])> {{ number_format($line['price'], 2, ',', ' ') }} {{ $currency }} @if ($line['discount_percent'] !== null) {{ number_format($line['price_base'], 2, ',', ' ') }} {{ $currency }} −{{ rtrim(rtrim(number_format($line['discount_percent'], 2, ',', ''), '0'), ',') }}% @endif @if ($line['price_changed']) было {{ number_format($line['price_at_add'], 2, ',', ' ') }} {{ $currency }} @endif @else {{ $noPrice }} @endif @php($quantity = (float) $line['item']->quantity) {{-- Три отдельные формы, а не счётчик на скрипте: минус, плюс и ручной ввод работают одинаково и без JavaScript. --}}
@csrf @method('put')
@csrf @method('put')
@csrf @method('put')
{{ number_format($line['sum'], 2, ',', ' ') }} {{ $currency }}
@csrf @method('delete')
@endif