Skip to content

Commit ec90be5

Browse files
authored
ENGCOM-4296: Patch 18017 magento 23 #19635
2 parents 1159204 + 5a9d6a5 commit ec90be5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,11 @@ define([
12381238

12391239
if (!_.isUndefined(gallery)) {
12401240
gallery.updateData(imagesToUpdate);
1241+
} else {
1242+
context.find(this.options.mediaGallerySelector).on('gallery:loaded', function (loadedGallery) {
1243+
loadedGallery = context.find(this.options.mediaGallerySelector).data('gallery');
1244+
loadedGallery.updateData(imagesToUpdate);
1245+
}.bind(this));
12411246
}
12421247

12431248
if (isInitial) {
@@ -1248,6 +1253,7 @@ define([
12481253
dataMergeStrategy: this.options.gallerySwitchStrategy
12491254
});
12501255
}
1256+
12511257
} else if (justAnImage && justAnImage.img) {
12521258
context.find('.product-image-photo').attr('src', justAnImage.img);
12531259
}

0 commit comments

Comments
 (0)