@if($showModal && $product)
@php $galleryImages = collect(); if ($selectedVariant && $selectedVariant->image_path) { $galleryImages->push(['path' => $selectedVariant->image_path, 'type' => 'variant']); } if ($product->images && $product->images->isNotEmpty()) { foreach($product->images as $img) { $galleryImages->push(['path' => $img->path, 'type' => 'product']); } } @endphp @if($galleryImages->isNotEmpty())
@if($galleryImages->count() > 1)
@endif @else

Sin imagen disponible

@endif
{{ $product->categoria->nombre ?? 'Sin categoría' }} {{ $product->marca->nombre ?? 'Sin marca' }}

{{ $product->name }}

@php $rating = $product->rating ?? 4.5; $fullStars = floor($rating); $halfStar = $rating - $fullStars >= 0.5; @endphp
@for($i = 1; $i <= 5; $i++) @if($i <= $fullStars) @elseif($halfStar && $i == $fullStars + 1) @else @endif @endfor
({{ $product->reviews_count ?? rand(10, 150) }} reseñas)
@php $stock = $selectedVariant->stock ?? $product->stock ?? 100; @endphp
@if($stock <= 0) Agotado @elseif($stock <= 5) Últimas {{ $stock }} unidades @else En stock @endif
@php $exchangeRate = \App\Models\ExchangeRate::getLatestRate('USD'); if ($selectedVariant) { if (isset($selectedVariant->price) && $selectedVariant->price > 0) { $finalPriceUsd = $selectedVariant->price; } else { $finalPriceUsd = $selectedVariant->price_adjustment ?? $product->price; } } else { $finalPriceUsd = $product->price; } if ($selectedVariant) { if (isset($selectedVariant->precio_bs) && $selectedVariant->precio_bs > 0) { $finalPriceBs = $selectedVariant->precio_bs; } else { $variantPriceUsd = $selectedVariant->price_adjustment ?? $product->price; $finalPriceBs = $variantPriceUsd * ($exchangeRate ?: 1); } } else { if (isset($product->precio_bs) && $product->precio_bs > 0) { $finalPriceBs = $product->precio_bs; } else { $finalPriceBs = $finalPriceUsd * ($exchangeRate ?: 1); } } @endphp
@if($currency === 'bs' && is_venezuela_company())
Precio: Bs. {{ number_format($finalPriceBs * $exchangeRate, 2, ',', '.') }}
@else
Precio: {{ format_money($finalPriceUsd) }}
@endif
@if($product->variants && $product->variants->isNotEmpty())

Variante

@foreach($product->variants as $variant)
{{ $variant->name ?? 'Variante ' . $loop->iteration }}
@endforeach
@endif

Cantidad

@endif
@push('styles') @endpush @section('scripts') @include('livewire.front.quick-view-js') @endsection