Skip to content

Commit c5674e5

Browse files
#22510: Static test fix.
1 parent 4e190ef commit c5674e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ protected function getHtmlOutput()
462462

463463
/**
464464
* @return string
465+
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
465466
*/
466467
public function getMediaCallback()
467468
{

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,8 @@ define([
745745
$wrapper = $this.parents('.' + $widget.options.classes.attributeOptionsWrapper),
746746
$label = $parent.find('.' + $widget.options.classes.attributeSelectedOptionLabelClass),
747747
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']);
749750

750751
if ($widget.inProductList) {
751752
$input = $widget.productForm.find(
@@ -785,9 +786,7 @@ define([
785786
$widget.options.jsonConfig.optionPrices
786787
]);
787788

788-
var checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId]['additional_data']);
789-
790-
if (1 == checkAdditionalData['update_product_preview_image']) {
789+
if (checkAdditionalData['update_product_preview_image'] === '1') {
791790
$widget._loadMedia(eventName);
792791
}
793792
$input.trigger('change');

0 commit comments

Comments
 (0)