Skip to content

Commit

Permalink
Fixed magento text swatch switches product image even if attribute fe…
Browse files Browse the repository at this point in the history
…ature is disabled
  • Loading branch information
ravi-chandra3197 committed Apr 26, 2019
1 parent 1e29a6c commit 4e190ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ public function getJsonSwatchConfig()
$attributeDataArray
);
}
if (isset($attributeDataArray['additional_data'])) {
$config[$attributeId]['additional_data'] = $attributeDataArray['additional_data'];
}
}

return $this->jsonEncoder->encode($config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,11 @@ define([
$widget.options.jsonConfig.optionPrices
]);

$widget._loadMedia(eventName);
var checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId]['additional_data']);

if (1 == checkAdditionalData['update_product_preview_image']) {
$widget._loadMedia(eventName);
}
$input.trigger('change');
},

Expand Down

0 comments on commit 4e190ef

Please sign in to comment.