diff --git a/config/rapidez/models.php b/config/rapidez/models.php index 864efc62c..d1575a9dc 100644 --- a/config/rapidez/models.php +++ b/config/rapidez/models.php @@ -15,6 +15,7 @@ 'option_value' => Rapidez\Core\Models\OptionValue::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_view' => Rapidez\Core\Models\ProductView::class, 'product_option' => Rapidez\Core\Models\ProductOption::class, diff --git a/resources/js/components/Product/Images.vue b/resources/js/components/Product/Images.vue index 3318c00aa..06152efbe 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, @@ -30,7 +31,8 @@ export default { Object.values(window.config.product.super_attributes).filter((attribute) => attribute.update_image).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) } }) }) @@ -52,7 +54,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') { @@ -77,7 +79,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 @@ -