diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php index 55344f2b8..fd0696fe3 100755 --- a/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php @@ -304,12 +304,12 @@ }); if (this.simpleProduct) { - this.config.variant_images[this.simpleProduct].forEach(function(video) { - galleryImages.unshift(video) + this.config.variant_images[this.simpleProduct].forEach(function(image) { + galleryImages.unshift(image) }); - this.config.variant_videos[this.simpleProduct].forEach(function(image) { - galleryImages.unshift(image) + this.config.variant_videos[this.simpleProduct].forEach(function(video) { + galleryImages.unshift(video) }); } }, diff --git a/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php b/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php index 354bee696..1b4e9a91f 100644 --- a/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php +++ b/packages/Webkul/Velocity/src/Resources/views/shop/products/view/configurable-options.blade.php @@ -318,15 +318,21 @@ }); if (this.simpleProduct) { - this.config.variant_images[this.simpleProduct].forEach(function(video) { - galleryImages.unshift(video) - }); - - this.config.variant_videos[this.simpleProduct].forEach(function(image) { + this.config.variant_images[this.simpleProduct].forEach(function(image) { galleryImages.unshift(image) }); + + this.config.variant_videos[this.simpleProduct].forEach(function(video) { + galleryImages.unshift(video) + }); } + galleryImages.forEach(function(image){ + if (image.type == 'video') { + image.small_image_url = image.medium_image_url = image.large_image_url = image.original_image_url= image.video_url; + } + }); + eventBus.$emit('configurable-variant-update-images-event', galleryImages); },