We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52130ac commit b92bbc4Copy full SHA for b92bbc4
app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js
@@ -1223,7 +1223,15 @@ define([
1223
}
1224
1225
imagesToUpdate = this._setImageIndex(imagesToUpdate);
1226
- gallery.updateData(imagesToUpdate);
+
1227
+ if (gallery === undefined) {
1228
+ context.find(this.options.mediaGallerySelector).on('gallery:loaded', function (loadedGallery) {
1229
+ loadedGallery = context.find(this.options.mediaGallerySelector).data('gallery');
1230
+ loadedGallery.updateData(imagesToUpdate);
1231
+ }.bind(this));
1232
+ } else {
1233
+ gallery.updateData(imagesToUpdate);
1234
+ }
1235
1236
if (isInitial) {
1237
$(this.options.mediaGallerySelector).AddFotoramaVideoEvents();
0 commit comments