{{ $translatedCategoryName }}
@php
$activeFilters = collect((array) ($appliedFilters ?? []))
->filter(fn ($value) => is_scalar($value) && trim((string) $value) !== '')
->values();
if (request()->filled('price_from') || request()->filled('price_to')) {
$priceFromLabel = trim((string) request('price_from', ''));
$priceToLabel = trim((string) request('price_to', ''));
$activeFilters->push(__('Цена: :from - :to', ['from' => $priceFromLabel, 'to' => $priceToLabel]));
}
foreach ((array) ($filters ?? []) as $filter) {
if ((string) ($filter['filter'] ?? 'select') !== 'range') {
continue;
}
$rangeKey = (string) ($filter['key'] ?? '');
if ($rangeKey === '') {
continue;
}
$fromParam = $rangeKey . '_from';
$toParam = $rangeKey . '_to';
if (!request()->filled($fromParam) && !request()->filled($toParam)) {
continue;
}
$fromLabel = trim((string) request($fromParam, ''));
$toLabel = trim((string) request($toParam, ''));
$activeFilters->push(__(':label: :from - :to', [
'label' => __($filter['label'] ?? $rangeKey),
'from' => $fromLabel,
'to' => $toLabel,
]));
}
@endphp
@if ($activeFilters->isNotEmpty())
@foreach ($activeFilters as $key => $value)
{{ $value }}
@endforeach
@endif
@forelse ($products as $product)
@include('partials.product-card', ['product' => $product])
@empty
{{ __('Пока нет товаров в этой категории.') }}
@endforelse
@endsection