@extends('layouts.app') @push('styles') @endpush @section('content') @php $locale = current_locale(); $labels = match($locale) { 'en' => [ 'catalog' => 'Catalog', 'buy' => 'Add to cart', 'contact' => 'Contact us', 'details' => 'Product details', 'kit' => 'Included', 'warranty' => 'Warranty', 'shipping' => 'Delivery', 'related' => 'You may also like', 'features' => 'Advantages', ], 'ru' => [ 'catalog' => 'Каталог', 'buy' => 'В корзину', 'contact' => 'Связаться', 'details' => 'О товаре', 'kit' => 'Комплектация', 'warranty' => 'Гарантия', 'shipping' => 'Доставка', 'related' => 'Вам может понравиться', 'features' => 'Преимущества', ], default => [ 'catalog' => 'Kataloq', 'buy' => 'Səbətə əlavə et', 'contact' => 'Əlaqə saxla', 'details' => 'Məhsul haqqında', 'kit' => 'Dəstə daxildir', 'warranty' => 'Zəmanət', 'shipping' => 'Çatdırılma', 'related' => 'Bunlar da maraqlı ola bilər', 'features' => 'Xüsusiyyətlər', 'more' => 'Daha ətraflı', ], }; $gallery = collect([$product->main_image ?: $product->image]) ->merge($product->gallery_images ?? []) ->filter() ->unique() ->values(); $features = collect($product->feature_sections ?? [])->filter(fn ($item) => !empty($item['image']) || !empty($item['title']) || !empty($item['text'])); if ($features->isEmpty() && $product->description) { $features = collect([[ 'image' => $gallery->first(), 'title' => $product->short_description ?: $product->name, 'text' => $product->description, ]]); } @endphp
{{ $product->name }}
@if($gallery->count() > 1) @endif

{{ $product->name }}

{{ $product->formattedPrice() }} @if($product->old_price){{ $product->formattedOldPrice() }}@endif
@include('partials.product-purchase-button', ['product' => $product, 'label' => $labels['buy'], 'contactLabel' => $labels['contact']])
@if($features->isNotEmpty())
@foreach($features as $index => $feature)
@if(!empty($feature['image']))
{{ $feature['title'] ?? $product->name }}
@endif
@if(!empty($feature['title']))

{{ $feature['title'] }}

@endif @if(!empty($feature['text']))

{{ $feature['text'] }}

@endif
@endforeach
@endif @if($product->description || $product->detailed_description || $product->kit_contents || $product->warranty_info || $product->shipping_info || $product->attributeValues->isNotEmpty())
{{ $product->name }}

{{ $labels['features'] }}

@if($product->attributeValues->isNotEmpty()) @foreach($product->attributeValues->filter(fn($value) => $value->attribute?->show_on_product)->groupBy('attribute.name') as $attributeName => $values)
{{ $attributeName }}{{ $values->pluck('name')->implode(', ') }}
@endforeach @endif
{{ __('category') }}{{ $product->category->name }}
{{ __('status') }}{{ __('available') }}
@if($product->kit_contents)
{{ $labels['kit'] }}{{ $product->kit_contents }}
@endif @if($product->warranty_info)
{{ $labels['warranty'] }}{{ $product->warranty_info }}
@endif @if($product->shipping_info)
{{ $labels['shipping'] }}{{ $product->shipping_info }}
@endif
{{ $labels['more'] ?? 'More details' }}

{{ $product->detailed_description ?: $product->description }}

@endif @if($relatedProducts->count()) @endif
@endsection