File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
app/code/Magento/Swatches/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -501,7 +501,9 @@ define([
501
501
label ,
502
502
width ,
503
503
height ,
504
- attr ;
504
+ attr ,
505
+ swatchImageWidth ,
506
+ swatchImageHeight ;
505
507
506
508
if ( ! optionConfig . hasOwnProperty ( this . id ) ) {
507
509
return '' ;
@@ -534,6 +536,9 @@ define([
534
536
' thumb-width="' + width + '"' +
535
537
' thumb-height="' + height + '"' ;
536
538
539
+ swatchImageWidth = _ . has ( sizeConfig , 'swatchImage' ) ? sizeConfig . swatchImage . width : 30 ;
540
+ swatchImageHeight = _ . has ( sizeConfig , 'swatchImage' ) ? sizeConfig . swatchImage . height : 20 ;
541
+
537
542
if ( ! this . hasOwnProperty ( 'products' ) || this . products . length <= 0 ) {
538
543
attr += ' option-empty="true"' ;
539
544
}
@@ -552,7 +557,7 @@ define([
552
557
// Image
553
558
html += '<div class="' + optionClass + ' image" ' + attr +
554
559
' style="background: url(' + value + ') no-repeat center; background-size: initial;width:' +
555
- sizeConfig . swatchImage . width + 'px; height:' + sizeConfig . swatchImage . height + 'px">' + '' +
560
+ swatchImageWidth + 'px; height:' + swatchImageHeight + 'px">' + '' +
556
561
'</div>' ;
557
562
} else if ( type === 3 ) {
558
563
// Clear
You can’t perform that action at this time.
0 commit comments