File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
app/code/Magento/Swatches Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,9 @@ public function getJsonSwatchConfig()
179
179
$ attributeDataArray
180
180
);
181
181
}
182
+ if (isset ($ attributeDataArray ['additional_data ' ])) {
183
+ $ config [$ attributeId ]['additional_data ' ] = $ attributeDataArray ['additional_data ' ];
184
+ }
182
185
}
183
186
184
187
return $ this ->jsonEncoder ->encode ($ config );
@@ -459,6 +462,7 @@ protected function getHtmlOutput()
459
462
460
463
/**
461
464
* @return string
465
+ * @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
462
466
*/
463
467
public function getMediaCallback ()
464
468
{
Original file line number Diff line number Diff line change @@ -745,7 +745,8 @@ define([
745
745
$wrapper = $this . parents ( '.' + $widget . options . classes . attributeOptionsWrapper ) ,
746
746
$label = $parent . find ( '.' + $widget . options . classes . attributeSelectedOptionLabelClass ) ,
747
747
attributeId = $parent . attr ( 'attribute-id' ) ,
748
- $input = $parent . find ( '.' + $widget . options . classes . attributeInput ) ;
748
+ $input = $parent . find ( '.' + $widget . options . classes . attributeInput ) ,
749
+ checkAdditionalData = JSON . parse ( this . options . jsonSwatchConfig [ attributeId ] [ 'additional_data' ] ) ;
749
750
750
751
if ( $widget . inProductList ) {
751
752
$input = $widget . productForm . find (
@@ -785,7 +786,9 @@ define([
785
786
$widget . options . jsonConfig . optionPrices
786
787
] ) ;
787
788
788
- $widget . _loadMedia ( eventName ) ;
789
+ if ( checkAdditionalData [ 'update_product_preview_image' ] === '1' ) {
790
+ $widget . _loadMedia ( eventName ) ;
791
+ }
789
792
$input . trigger ( 'change' ) ;
790
793
} ,
791
794
You can’t perform that action at this time.
0 commit comments