@extends('layouts.app') @section('title', $product['name'] . ' — ' . config('app.name')) @section('description', $product['description']) @section('content')
{{-- Image --}} {{-- relative: anchors the wishlist heart to the top right, which is the main image's corner (thumbnails sit on the left). --}}
@if(!empty($product['media'])) {{-- Thumbnails --}}
@foreach($product['media'] as $i => $media) @endforeach
{{-- Main image --}} {{-- Lightbox --}} @else
{{ __('storefront.product.no_image') }}
@endif
{{-- Info --}}

{{ $product['name'] }}

@if($product['price'] !== null)

@endif @php $desc = html_entity_decode(strip_tags($product['description'] ?? ''), ENT_QUOTES | ENT_HTML5, 'UTF-8'); $descTruncated = Str::limit($desc, 137); $descNeedsMore = mb_strlen($desc) > mb_strlen(rtrim($descTruncated, '.')); @endphp
{{ $descTruncated }} @if($descNeedsMore) {{ __('storefront.product.read_more') }} @endif
@foreach($productOptions as $productOption) @if($productOption['isColor']) @else @endif @endforeach @php // Same initial pick as product-form-controller.js's connect() // (?variant= or the first), so the button doesn't flip on load. $initialVariant = collect($variantsData)->firstWhere('id', (int) request('variant')) ?? ($variantsData[0] ?? null); @endphp @if(!empty($product['custom_fields'])) @endif
{{ __('storefront.product.add_to_cart') }}
{{-- Storefront-owned, not part of the checkout module — the local stock pre-check in product-form-controller.js stops an over-limit submit before it ever reaches the module and reports it here. --}}
{!! $product['description'] !!}
@if(session('reviewSubmitted'))

{{ __('storefront.review.thank_you') }}

@endif @if(!empty($product['reviews']['items']))
@foreach($product['reviews']['items'] as $review) @endforeach
@else

{{ __('storefront.review.no_reviews_yet') }}

@endif

{{ $product['reviews']['count'] > 0 ? __('storefront.review.write_new') : __('storefront.review.write_first') }} {{ __('storefront.review.for_product', ['name' => $product['name']]) }}

@if(!empty($product['recommendations'])) @endif
@endsection