This commit is contained in:
65
resources/views/shop/compare.blade.php
Normal file
65
resources/views/shop/compare.blade.php
Normal file
@@ -0,0 +1,65 @@
|
||||
@extends('layouts.shop')
|
||||
|
||||
@section('content')
|
||||
@include('partials.breadcrumbs', [
|
||||
'items' => [
|
||||
['label' => 'Главная', 'url' => route('home')],
|
||||
['label' => 'Сравнение', 'url' => null],
|
||||
],
|
||||
])
|
||||
|
||||
<section class="pc-section">
|
||||
<div class="pc-section-title">
|
||||
<h2>Сравнение товаров</h2>
|
||||
</div>
|
||||
|
||||
@if ($products->isEmpty())
|
||||
<div class="pc-card">
|
||||
<h3>Список сравнения пуст</h3>
|
||||
<p>Добавьте товары в сравнение из карточек каталога.</p>
|
||||
<a class="pc-btn primary" href="{{ route('catalog.index') }}">Перейти в каталог</a>
|
||||
</div>
|
||||
@else
|
||||
<div class="pc-compare-actions">
|
||||
<form method="post" action="{{ route('compare.clear') }}" data-preserve-scroll="true">
|
||||
@csrf
|
||||
@method('delete')
|
||||
<button class="pc-btn ghost" type="submit">Очистить сравнение</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="pc-products-grid">
|
||||
@foreach ($products as $product)
|
||||
@include('partials.product-card', ['product' => $product])
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
@if ($specKeys->isNotEmpty())
|
||||
<div class="pc-card pc-compare-table-wrap">
|
||||
<div class="pc-table-scroll">
|
||||
<table class="pc-compare-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Характеристика</th>
|
||||
@foreach ($products as $product)
|
||||
<th>{{ $product->name }}</th>
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($specKeys as $key)
|
||||
<tr>
|
||||
<th>{{ $specLabels[$key] ?? $key }}</th>
|
||||
@foreach ($products as $product)
|
||||
<td>{{ data_get($product->specs, $key, '—') }}</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</section>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user