Skip to content

Commit 6ce2026

Browse files
committed
#19184: Static test fix.
1 parent dfaee8e commit 6ce2026

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ public function getJsonSwatchConfig()
192192

193193
/**
194194
* Get number of swatches from config to show on product listing.
195+
*
195196
* Other swatches can be shown after click button 'Show more'
196197
*
197198
* @return string
@@ -231,6 +232,8 @@ public function getProduct()
231232
}
232233

233234
/**
235+
* Get swatch attributes data.
236+
*
234237
* @return array
235238
*/
236239
protected function getSwatchAttributesData()
@@ -239,6 +242,8 @@ protected function getSwatchAttributesData()
239242
}
240243

241244
/**
245+
* Init isProductHasSwatchAttribute.
246+
*
242247
* @deprecated 100.1.5 Method isProductHasSwatchAttribute() is used instead of this.
243248
*
244249
* @codeCoverageIgnore
@@ -367,6 +372,8 @@ protected function getVariationMedia($attributeCode, $optionId)
367372
}
368373

369374
/**
375+
* Get swatch product image.
376+
*
370377
* @param Product $childProduct
371378
* @param string $imageType
372379
* @return string
@@ -387,6 +394,8 @@ protected function getSwatchProductImage(Product $childProduct, $imageType)
387394
}
388395

389396
/**
397+
* Check if product have image.
398+
*
390399
* @param Product $product
391400
* @param string $imageType
392401
* @return bool
@@ -397,6 +406,8 @@ protected function isProductHasImage(Product $product, $imageType)
397406
}
398407

399408
/**
409+
* Get configurable options ids.
410+
*
400411
* @param array $attributeData
401412
* @return array
402413
* @since 100.0.3
@@ -456,15 +467,17 @@ protected function getRendererTemplate()
456467
}
457468

458469
/**
470+
* @inheritDoc
459471
* @deprecated 100.1.5 Now is used _toHtml() directly
460-
* @return string
461472
*/
462473
protected function getHtmlOutput()
463474
{
464475
return parent::_toHtml();
465476
}
466477

467478
/**
479+
* Get media callback url.
480+
*
468481
* @return string
469482
*/
470483
public function getMediaCallback()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,9 +753,9 @@ define([
753753
$widget.options.jsonConfig.optionPrices
754754
]);
755755

756-
const checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId].additional_data);
756+
var checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId]['additional_data']);
757757

758-
if (checkAdditionalData.update_product_preview_image == 1) {
758+
if (1 == checkAdditionalData['update_product_preview_image']) {
759759
$widget._loadMedia();
760760
}
761761

0 commit comments

Comments
 (0)