File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
app/code/Magento/ConfigurableProduct/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -268,26 +268,26 @@ define([
268
268
*/
269
269
_changeProductImage : function ( ) {
270
270
var images ,
271
- initialImages = $ . extend ( true , [ ] , this . options . mediaGalleryInitial ) ,
271
+ initialImages = this . options . mediaGalleryInitial ,
272
272
galleryObject = $ ( this . options . mediaGallerySelector ) . data ( 'gallery' ) ;
273
273
274
274
if ( ! galleryObject ) {
275
275
return ;
276
276
}
277
277
278
- if ( this . options . spConfig . images [ this . simpleProduct ] ) {
279
- images = $ . extend ( true , [ ] , this . options . spConfig . images [ this . simpleProduct ] ) ;
280
- }
278
+ images = this . options . spConfig . images [ this . simpleProduct ] ;
281
279
282
280
if ( images ) {
283
- images . forEach ( function ( img ) {
284
- img . type = 'image' ;
285
- } ) ;
286
-
287
281
if ( this . options . gallerySwitchStrategy === 'prepend' ) {
288
282
images = images . concat ( initialImages ) ;
289
283
}
290
284
285
+ images = $ . extend ( true , [ ] , images ) ;
286
+
287
+ images . forEach ( function ( img ) {
288
+ img . type = 'image' ;
289
+ } ) ;
290
+
291
291
galleryObject . updateData ( images ) ;
292
292
} else {
293
293
galleryObject . updateData ( initialImages ) ;
You can’t perform that action at this time.
0 commit comments