@extends('site.layout.layout') @section('title',__('Used Products')) @section('content')

{{ __('Used Products') }}

@forelse($categories as $category)
{{ $category->getTranslation('title',app()->getLocale()) }}
@empty

{{ __('There are no categories to display.') }}

@endforelse

{{ __('Search results') }} {{ $products->total() }}

({{ App\Models\Product::where('sale_status','!=',1)->where('status',1)->where('count','>=',1)->whereHas('store',fn($q) => $q->where('status',1))->count() }})

@include('site.products.filter_items', ['items' => $categories, 'type' => 'category'])
@if($categories->hasMorePages()) @endif

({{ App\Models\Product::where('sale_status','!=',1)->where('status',1)->where('count','>=',1)->whereHas('store', fn($q) => $q->where('status',1))->count() }})

@include('site.products.filter_items', ['items' => $cities, 'type' => 'city'])
@if($cities->hasMorePages()) @endif

({{ App\Models\Product::where('sale_status','!=',1)->where('status',1)->where('count','>=',1)->whereHas('store',fn($q) => $q->where('status',1))->count() }})

@include('site.products.filter_items', ['items' => $subCategories, 'type' => 'subCategory'])
@if($subCategories->hasMorePages()) @endif

@php $roundedMaxPrice = ceil($maxPrice / 100) * 100; @endphp

({{ $rates[5] }})

({{ $rates[4] }})

({{ $rates[3] }})

({{ $rates[2] }})

({{ $rates[1] }})

@include('site.products.used_product_cards', ['products' => $products])
@if($products->hasMorePages()) @php $total = $products->total(); $perPage = $products->perPage(); $currentPage = $products->currentPage(); $shown = $currentPage * $perPage; $shown = $shown > $total ? $total : $shown; $percentage = $total > 0 ? round(($shown / $total) * 100) : 0; @endphp

{{ __('Total ') }} {{ $shown }} / {{ $total }} {{ __('product') }}

@endif
@endsection @push('scripts') @endpush