@@ -23,9 +23,9 @@
|
||||
'@context' => 'https://schema.org',
|
||||
'@type' => 'Product',
|
||||
'name' => $product->name,
|
||||
'description' => $product->short_description ?: ($product->description ?: "Купить {$product->name} по выгодной цене."),
|
||||
'description' => __($product->short_description ?: ($product->description ?: __('Купить :product по выгодной цене.', ['product' => $product->name]))),
|
||||
'sku' => $product->sku ?: null,
|
||||
'category' => $product->category?->name,
|
||||
'category' => $product->category?->name ? __($product->category->name) : null,
|
||||
'image' => $productSchemaImages,
|
||||
'url' => route('products.show', $product),
|
||||
'offers' => [
|
||||
@@ -47,8 +47,8 @@
|
||||
@endphp
|
||||
|
||||
@section('meta_title', $product->name)
|
||||
@section('meta_description', \Illuminate\Support\Str::limit(strip_tags($product->short_description ?: ($product->description ?: "Купить {$product->name} по выгодной цене.")), 160))
|
||||
@section('meta_keywords', $product->name . ', ' . ($product->category?->name ?? 'товар') . ', купить')
|
||||
@section('meta_description', \Illuminate\Support\Str::limit(strip_tags(__($product->short_description ?: ($product->description ?: __('Купить :product по выгодной цене.', ['product' => $product->name])))), 160))
|
||||
@section('meta_keywords', __(':product, :category, купить', ['product' => $product->name, 'category' => $product->category?->name ? __($product->category->name) : __('товар')]))
|
||||
@section('meta_canonical', route('products.show', $product))
|
||||
@section('meta_image', $productImageUrl)
|
||||
@section('meta_image_alt', $product->name)
|
||||
@@ -72,9 +72,9 @@
|
||||
|
||||
@include('partials.breadcrumbs', [
|
||||
'items' => [
|
||||
['label' => 'Главная', 'url' => route('home')],
|
||||
['label' => 'Каталог', 'url' => route('catalog.index')],
|
||||
['label' => $product->category?->name ?? 'Категория', 'url' => $product->category ? route('catalog.category', $product->category) : null],
|
||||
['label' => __('Главная'), 'url' => route('home')],
|
||||
['label' => __('Каталог'), 'url' => route('catalog.index')],
|
||||
['label' => $product->category?->name ? __($product->category->name) : __('Категория'), 'url' => $product->category ? route('catalog.category', $product->category) : null],
|
||||
['label' => $product->name, 'url' => null],
|
||||
],
|
||||
])
|
||||
@@ -96,20 +96,20 @@
|
||||
@endif
|
||||
|
||||
@if (count($productGallery) > 1)
|
||||
<div class="pc-product-thumbs" aria-label="Дополнительные изображения товара">
|
||||
<div class="pc-product-thumbs" aria-label="{{ __('Дополнительные изображения товара') }}">
|
||||
@foreach ($productGallery as $imageUrl)
|
||||
<button
|
||||
class="pc-product-thumb {{ $loop->first ? 'is-active' : '' }}"
|
||||
type="button"
|
||||
data-product-gallery-thumb
|
||||
data-image-src="{{ $imageUrl }}"
|
||||
data-image-alt="{{ $product->name }} - фото {{ $loop->iteration }}"
|
||||
aria-label="Показать фото {{ $loop->iteration }}"
|
||||
data-image-alt="{{ __(':product - фото :number', ['product' => $product->name, 'number' => $loop->iteration]) }}"
|
||||
aria-label="{{ __('Показать фото :number', ['number' => $loop->iteration]) }}"
|
||||
aria-pressed="{{ $loop->first ? 'true' : 'false' }}"
|
||||
>
|
||||
<img
|
||||
src="{{ $imageUrl }}"
|
||||
alt="{{ $product->name }} - миниатюра {{ $loop->iteration }}"
|
||||
alt="{{ __(':product - миниатюра :number', ['product' => $product->name, 'number' => $loop->iteration]) }}"
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
>
|
||||
@@ -120,10 +120,10 @@
|
||||
</div>
|
||||
<div class="pc-product-info">
|
||||
<h1>{{ $product->name }}</h1>
|
||||
<p class="pc-muted">{{ $product->short_description }}</p>
|
||||
<p class="pc-muted">{{ __($product->short_description) }}</p>
|
||||
<div class="pc-product-badges">
|
||||
@if ($product->sku)
|
||||
<span class="pc-sku">Артикул: {{ $product->sku }}</span>
|
||||
<span class="pc-sku">{{ __('Артикул:') }} {{ $product->sku }}</span>
|
||||
@endif
|
||||
</div>
|
||||
<div class="pc-product-price">
|
||||
@@ -137,22 +137,22 @@
|
||||
<form method="post" action="{{ route('cart.add', $product) }}" data-preserve-scroll="true">
|
||||
@csrf
|
||||
<button class="pc-btn primary {{ $isInCart ? 'is-active' : '' }}" type="submit">
|
||||
{{ $isInCart ? 'В корзине' : 'В корзину' }}
|
||||
{{ $isInCart ? __('В корзине') : __('В корзину') }}
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<button class="pc-btn primary" type="button" disabled>Нет в наличии</button>
|
||||
<button class="pc-btn primary" type="button" disabled>{{ __('Нет в наличии') }}</button>
|
||||
@endif
|
||||
<form method="post" action="{{ route('favorites.toggle', $product) }}" data-preserve-scroll="true">
|
||||
@csrf
|
||||
<button class="pc-btn ghost {{ $isFavorite ? 'is-active' : '' }}" type="submit">
|
||||
{{ $isFavorite ? 'Убрать из избранного' : 'В избранное' }}
|
||||
{{ $isFavorite ? __('Убрать из избранного') : __('В избранное') }}
|
||||
</button>
|
||||
</form>
|
||||
<form method="post" action="{{ route('compare.toggle', $product) }}" data-preserve-scroll="true">
|
||||
@csrf
|
||||
<button class="pc-btn ghost {{ $isCompared ? 'is-active' : '' }}" type="submit">
|
||||
{{ $isCompared ? 'Убрать из сравнения' : 'В сравнение' }}
|
||||
{{ $isCompared ? __('Убрать из сравнения') : __('В сравнение') }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@@ -166,10 +166,10 @@
|
||||
<input type="radio" name="product-tabs" id="tab-payment">
|
||||
|
||||
<div class="pc-tab-labels">
|
||||
<label for="tab-specs">Характеристики</label>
|
||||
<label for="tab-desc">Описание</label>
|
||||
<label for="tab-shipping">Доставка</label>
|
||||
<label for="tab-payment">Оплата</label>
|
||||
<label for="tab-specs">{{ __('Характеристики') }}</label>
|
||||
<label for="tab-desc">{{ __('Описание') }}</label>
|
||||
<label for="tab-shipping">{{ __('Доставка') }}</label>
|
||||
<label for="tab-payment">{{ __('Оплата') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="pc-tab-content">
|
||||
@@ -177,29 +177,29 @@
|
||||
<div class="pc-specs-grid">
|
||||
@forelse (($product->specs ?? []) as $key => $value)
|
||||
<div class="pc-spec-row">
|
||||
<span>{{ $specLabels[$key] ?? str_replace('_', ' ', $key) }}</span>
|
||||
<strong>{{ $value }}</strong>
|
||||
<span>{{ __($specLabels[$key] ?? str_replace('_', ' ', $key)) }}</span>
|
||||
<strong>{{ __((string) $value) }}</strong>
|
||||
</div>
|
||||
@empty
|
||||
<p class="pc-muted">Характеристики еще не добавлены.</p>
|
||||
<p class="pc-muted">{{ __('Характеристики еще не добавлены.') }}</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</section>
|
||||
<section class="pc-tab-panel pc-tab-desc">
|
||||
<p class="pc-muted">{{ $product->description ?? 'Описание товара будет добавлено позже.' }}</p>
|
||||
<p class="pc-muted">{{ __($product->description ?? __('Описание товара будет добавлено позже.')) }}</p>
|
||||
</section>
|
||||
<section class="pc-tab-panel pc-tab-shipping">
|
||||
<ul class="pc-list">
|
||||
<li>Доставка курьером по городу</li>
|
||||
<li>Самовывоз из пункта выдачи</li>
|
||||
<li>Отправка по стране 1-3 дня</li>
|
||||
<li>{{ __('Доставка курьером по городу') }}</li>
|
||||
<li>{{ __('Самовывоз из пункта выдачи') }}</li>
|
||||
<li>{{ __('Отправка по стране 1-3 дня') }}</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section class="pc-tab-panel pc-tab-payment">
|
||||
<ul class="pc-list">
|
||||
<li>Оплата картой онлайн</li>
|
||||
<li>Банковский перевод</li>
|
||||
<li>Рассрочка на крупные заказы</li>
|
||||
<li>{{ __('Оплата картой онлайн') }}</li>
|
||||
<li>{{ __('Банковский перевод') }}</li>
|
||||
<li>{{ __('Рассрочка на крупные заказы') }}</li>
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
@@ -209,7 +209,7 @@
|
||||
@if ($related->isNotEmpty())
|
||||
<section class="pc-section">
|
||||
<div class="pc-section-title">
|
||||
<h2>Что еще посмотреть в этой категории</h2>
|
||||
<h2>{{ __('Что еще посмотреть в этой категории') }}</h2>
|
||||
</div>
|
||||
<div class="pc-products-grid">
|
||||
@foreach ($related as $item)
|
||||
|
||||
Reference in New Issue
Block a user