diff --git a/resources/views/components/quantity.blade.php b/resources/views/components/quantity.blade.php index 940abf09..689229ad 100644 --- a/resources/views/components/quantity.blade.php +++ b/resources/views/components/quantity.blade.php @@ -6,6 +6,7 @@
-
\ No newline at end of file + diff --git a/resources/views/product/partials/gallery/slider.blade.php b/resources/views/product/partials/gallery/slider.blade.php index 029ac896..62b7003b 100644 --- a/resources/views/product/partials/gallery/slider.blade.php +++ b/resources/views/product/partials/gallery/slider.blade.php @@ -1,23 +1,28 @@
{{ $product->name }} - - + + @if (count($product->images ?? []) > 1) + + + @endif
- + diff --git a/resources/views/product/partials/gallery/thumbnails.blade.php b/resources/views/product/partials/gallery/thumbnails.blade.php index de5cd213..dc319796 100644 --- a/resources/views/product/partials/gallery/thumbnails.blade.php +++ b/resources/views/product/partials/gallery/thumbnails.blade.php @@ -1,40 +1,47 @@ -@php($breakpoints = ['xl' => 7, 'lg' => 5, 'md' => 4, 'sm' => 3, 'xs' => 4]) -
- + images)) + src="/storage/{{ config('rapidez.store') }}/resizes/80x80/magento/catalog/product/{{ $product->images[$imageId] }}.webp" + @endif + v-bind:src="'/storage/{{ config('rapidez.store') }}/resizes/80x80/magento/catalog/product/' + images[{{ $imageId }}] + '.webp'" + alt="{{ $product->name }}" + class="block max-h-full w-auto object-contain" + width="80" + height="80" + /> + + {{-- Only include the showMore if it's actually possible to be visible --}} + @includeWhen(in_array($imageId + 1, $breakpoints), 'rapidez::product.partials.gallery.thumbnails.show-more') + + @endfor
diff --git a/resources/views/product/partials/gallery/thumbnails/show-more.blade.php b/resources/views/product/partials/gallery/thumbnails/show-more.blade.php new file mode 100644 index 00000000..d12ce95c --- /dev/null +++ b/resources/views/product/partials/gallery/thumbnails/show-more.blade.php @@ -0,0 +1,25 @@ +{{-- This component shows an overlay on the last shown thumbnail if there are more thumbnails after it. --}} + +
!(count($product->images) - $imageId - 1), + 'v-if' => 'images.length - ' . $imageId . ' - 1', +])> + +
diff --git a/resources/views/product/partials/images.blade.php b/resources/views/product/partials/images.blade.php index a8e9c54b..0d235a9a 100644 --- a/resources/views/product/partials/images.blade.php +++ b/resources/views/product/partials/images.blade.php @@ -4,21 +4,8 @@ @include('rapidez::wishlist.button') @endif - @if (count($product->images)) -
-
- {{ $product->name }} -
-
- @endif - +
@include('rapidez::product.partials.gallery.slider') @@ -28,4 +15,4 @@ class="max-h-full w-full object-contain" @include('rapidez::product.partials.gallery.popup')
-
\ No newline at end of file +