Skip to content

Commit 00ea64a

Browse files
committed
Issue 36243: hide duplicate pictures when the product color is switched
1 parent 5dc13c3 commit 00ea64a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,10 @@ define([
13041304
}
13051305

13061306
imagesToUpdate = images.length ? this._setImageType($.extend(true, [], images)) : [];
1307-
isInitial = _.isEqual(imagesToUpdate, initialImages);
1307+
isInitial = _.isEqual(
1308+
imagesToUpdate.map(({thumb, img, full, type, videoUrl}) => ({thumb, img, full, type, videoUrl})),
1309+
initialImages.map(({thumb, img, full, type, videoUrl}) => ({thumb, img, full, type, videoUrl}))
1310+
);
13081311

13091312
if (this.options.gallerySwitchStrategy === 'prepend' && !isInitial) {
13101313
imagesToUpdate = imagesToUpdate.concat(initialImages);

0 commit comments

Comments
 (0)