@extends('layouts.shop') @php $productGallery = $product->gallery_urls; $productImage = $productGallery[0] ?? ($product->image_url ?: config('seo.default_image')); $productImageUrl = str_starts_with($productImage, 'http://') || str_starts_with($productImage, 'https://') ? $productImage : url($productImage); $productSchemaImages = array_map( fn (string $image) => str_starts_with($image, 'http://') || str_starts_with($image, 'https://') ? $image : url($image), $productGallery !== [] ? array_values($productGallery) : [$productImageUrl] ); $manufacturer = trim((string) ($product->specs['manufacturer'] ?? '')); $conditionRaw = mb_strtolower(trim((string) ($product->specs['condition'] ?? ''))); $itemCondition = str_contains($conditionRaw, 'б/у') || str_contains($conditionRaw, 'used') ? 'https://schema.org/UsedCondition' : 'https://schema.org/NewCondition'; $productSchema = [ '@context' => 'https://schema.org', '@type' => 'Product', 'name' => $product->name, 'description' => __($product->short_description ?: ($product->description ?: __('Купить :product по выгодной цене.', ['product' => $product->name]))), 'sku' => $product->sku ?: null, 'category' => $product->category?->name ? __($product->category->name) : null, 'image' => $productSchemaImages, 'url' => route('products.show', $product), 'offers' => [ '@type' => 'Offer', 'priceCurrency' => config('shop.currency_code', 'RUB'), 'price' => (string) $product->price, 'availability' => $product->stock > 0 ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock', 'itemCondition' => $itemCondition, 'url' => route('products.show', $product), ], ]; if ($manufacturer !== '') { $productSchema['brand'] = [ '@type' => 'Brand', 'name' => $manufacturer, ]; } @endphp @section('meta_title', $product->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) @section('meta_og_type', 'product') @push('structured_data') @endpush @section('content') @php $favoriteIds = array_map('intval', (array) session('favorites', [])); $compareIds = array_map('intval', (array) session('compare', [])); $isFavorite = in_array($product->id, $favoriteIds, true); $isCompared = in_array($product->id, $compareIds, true); $cartItems = (array) session('cart', []); $isInCart = isset($cartItems[$product->id]); @endphp @include('partials.breadcrumbs', [ 'items' => [ ['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], ], ])

{{ $product->name }}

{{ __($product->short_description) }}

@if ($product->sku) {{ __('Артикул:') }} {{ $product->sku }} @endif
{{ number_format($product->price, 0, '.', ' ') }} {{ config('shop.currency_symbol', '₽') }} @if (!empty($product->old_price)) {{ number_format($product->old_price, 0, '.', ' ') }} {{ config('shop.currency_symbol', '₽') }} @endif
@if ($product->stock > 0)
@csrf
@else @endif
@csrf
@csrf
@forelse (($product->specs ?? []) as $key => $value)
{{ __($specLabels[$key] ?? str_replace('_', ' ', $key)) }} {{ __((string) $value) }}
@empty

{{ __('Характеристики еще не добавлены.') }}

@endforelse

{{ __($product->description ?? __('Описание товара будет добавлено позже.')) }}

  • {{ __('Доставка курьером по городу') }}
  • {{ __('Самовывоз из пункта выдачи') }}
  • {{ __('Отправка по стране 1-3 дня') }}
  • {{ __('Оплата картой онлайн') }}
  • {{ __('Банковский перевод') }}
  • {{ __('Рассрочка на крупные заказы') }}
@if ($related->isNotEmpty())

{{ __('Что еще посмотреть в этой категории') }}

@foreach ($related as $item) @include('partials.product-card', ['product' => $item]) @endforeach
@endif @endsection