diff --git a/config/rapidez/models.php b/config/rapidez/models.php index 3204acc45..719de666b 100644 --- a/config/rapidez/models.php +++ b/config/rapidez/models.php @@ -22,6 +22,7 @@ 'product' => Rapidez\Core\Models\Product::class, 'product_image' => Rapidez\Core\Models\ProductImage::class, 'product_image_value' => Rapidez\Core\Models\ProductImageValue::class, + 'product_video_value' => Rapidez\Core\Models\ProductVideoValue::class, 'product_link' => Rapidez\Core\Models\ProductLink::class, 'product_option' => Rapidez\Core\Models\ProductOption::class, 'product_option_price' => Rapidez\Core\Models\ProductOptionPrice::class, diff --git a/resources/js/components/Product/Images.vue b/resources/js/components/Product/Images.vue index 613e53857..9553b328f 100644 --- a/resources/js/components/Product/Images.vue +++ b/resources/js/components/Product/Images.vue @@ -4,6 +4,7 @@ import { useEventListener } from '@vueuse/core' export default { data: () => ({ images: config.product.images, + media: config.product.media, active: 0, zoomed: false, touchStartX: 0, @@ -32,7 +33,8 @@ export default { ).length ) { self.images = simpleProduct.images - self.active = Math.min(self.active, self.images.length - 1) + self.media = simpleProduct.media + self.active = Math.min(self.active, self.media.length - 1) } }) }) @@ -54,7 +56,7 @@ export default { if (e.key == 'ArrowLeft' && this.active > 0) { // left this.active-- - } else if (e.key == 'ArrowRight' && this.active < this.images.length - 1) { + } else if (e.key == 'ArrowRight' && this.active < this.media.length - 1) { // right this.active++ } else if (e.key == 'Escape') { @@ -79,7 +81,7 @@ export default { return } - if (distance < 0 && this.active < this.images.length - 1) { + if (distance < 0 && this.active < this.media.length - 1) { this.change(this.active + 1) } else if (distance > 0 && this.active > 0) { this.change(this.active - 1) diff --git a/resources/views/product/partials/gallery/popup.blade.php b/resources/views/product/partials/gallery/popup.blade.php index 1959bbaec..642ff12f1 100644 --- a/resources/views/product/partials/gallery/popup.blade.php +++ b/resources/views/product/partials/gallery/popup.blade.php @@ -1,11 +1,23 @@ -
+
{{ $product->name }} +
@@ -13,7 +25,7 @@ class="object-contain max-h-full mx-auto block" -
diff --git a/resources/views/product/partials/gallery/slider.blade.php b/resources/views/product/partials/gallery/slider.blade.php index 8325ae1c2..f5b540c1d 100644 --- a/resources/views/product/partials/gallery/slider.blade.php +++ b/resources/views/product/partials/gallery/slider.blade.php @@ -1,13 +1,14 @@ -
+
{{ $product->name }} + - @if (count($selectedChild->images ?? []) > 1) + @if (count($selectedChild->media ?? []) > 1) - @endif diff --git a/resources/views/product/partials/gallery/thumbnails.blade.php b/resources/views/product/partials/gallery/thumbnails.blade.php index ae3452095..7e70d66b1 100644 --- a/resources/views/product/partials/gallery/thumbnails.blade.php +++ b/resources/views/product/partials/gallery/thumbnails.blade.php @@ -10,8 +10,8 @@ @for ($imageId = 0; $imageId < max($breakpoints); $imageId++)