File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
app/code/Magento/Swatches Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -332,14 +332,14 @@ public function getProductMediaGallery(ModelProduct $product): array
332
332
$ baseImage = $ mediaEntry ->getFile ();
333
333
}
334
334
335
- $ gallery [$ mediaEntry ->getId ()] = $ this ->collectImageData ($ mediaEntry );
335
+ $ gallery [$ mediaEntry ->getId ()] = $ this ->collectImageData ($ product , $ mediaEntry );
336
336
}
337
337
338
338
if (!$ baseImage ) {
339
339
return [];
340
340
}
341
341
342
- $ resultGallery = $ this ->collectImageData ($ baseImage );
342
+ $ resultGallery = $ this ->collectImageData ($ product , $ baseImage );
343
343
$ resultGallery ['gallery ' ] = $ gallery ;
344
344
345
345
return $ resultGallery ;
@@ -359,14 +359,17 @@ private function isMainImage(ProductAttributeMediaGalleryEntryInterface $mediaEn
359
359
/**
360
360
* Returns image data for swatches
361
361
*
362
+ * @param ModelProduct $product
362
363
* @param ProductAttributeMediaGalleryEntryInterface $mediaEntry
363
364
* @return array
364
365
*/
365
- private function collectImageData (ProductAttributeMediaGalleryEntryInterface $ mediaEntry ): array
366
- {
367
- $ image = $ this ->getAllSizeImages ($ mediaEntry ->getFile ());
368
- $ image [ProductAttributeMediaGalleryEntryInterface::POSITION ] = $ mediaEntry ->getPosition ();
369
- $ image ['isMain ' ] =$ this ->isMainImage ($ mediaEntry );
366
+ private function collectImageData (
367
+ ModelProduct $ product ,
368
+ ProductAttributeMediaGalleryEntryInterface $ mediaEntry
369
+ ): array {
370
+ $ image = $ this ->getAllSizeImages ($ product , $ mediaEntry ->getFile ());
371
+ $ image [ProductAttributeMediaGalleryEntryInterface::POSITION ] = $ mediaEntry ->getPosition ();
372
+ $ image ['isMain ' ] = $ this ->isMainImage ($ mediaEntry );
370
373
return $ image ;
371
374
}
372
375
Original file line number Diff line number Diff line change @@ -667,10 +667,9 @@ define([
667
667
/**
668
668
* Load media gallery using ajax or json config.
669
669
*
670
- * @param {String|undefined } eventName
671
670
* @private
672
671
*/
673
- _loadMedia : function ( eventName ) {
672
+ _loadMedia : function ( ) {
674
673
var $main = this . inProductList ?
675
674
this . element . parents ( '.product-item-info' ) :
676
675
this . element . parents ( '.column.main' ) ,
You can’t perform that action at this time.
0 commit comments