@php use Botble\Media\Facades\RvMedia; // $productImages is provided by plugins/ecommerce HandleFrontPages — it // resolves the active variation from URL params (?color=…&size=…) and // returns that variation's images. Fall back to the parent product's // images when no variation matches or the controller didn't pass it. $images = ($productImages ?? null) ?: ($product->images ?: [$product->image]); $hasVideo = (bool) ($product->video_url ?? false); $videoUrl = $product->video_url ?? null; $zoomType = $product->zoom_type ?? theme_option('ecommerce_zoom_type', 'inner'); @endphp
@foreach ($images as $index => $image) @php $imageUrl = RvMedia::getImageUrl($image); @endphp
@if ($hasVideo && $index === 0 && $videoUrl) @include(Theme::getThemeNamespace('views.ecommerce.includes.product-video'), ['videoUrl' => $videoUrl]) @else {{ $product->name }} @endif
@endforeach
@if ($zoomType === 'external' || $zoomType === 'lightbox') @include(Theme::getThemeNamespace('views.ecommerce.includes.product-zoom-external')) @endif