diff --git a/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php b/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php index fe9c7cdd07de2..0848f566f67bb 100644 --- a/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php +++ b/app/code/Magento/Swatches/Block/Product/Renderer/Configurable.php @@ -192,6 +192,7 @@ public function getJsonSwatchConfig() /** * Get number of swatches from config to show on product listing. + * * Other swatches can be shown after click button 'Show more' * * @return string @@ -231,6 +232,8 @@ public function getProduct() } /** + * Get swatch attributes data. + * * @return array */ protected function getSwatchAttributesData() @@ -239,6 +242,8 @@ protected function getSwatchAttributesData() } /** + * Init isProductHasSwatchAttribute. + * * @deprecated 100.1.5 Method isProductHasSwatchAttribute() is used instead of this. * * @codeCoverageIgnore @@ -367,6 +372,8 @@ protected function getVariationMedia($attributeCode, $optionId) } /** + * Get swatch product image. + * * @param Product $childProduct * @param string $imageType * @return string @@ -387,6 +394,8 @@ protected function getSwatchProductImage(Product $childProduct, $imageType) } /** + * Check if product have image. + * * @param Product $product * @param string $imageType * @return bool @@ -397,6 +406,8 @@ protected function isProductHasImage(Product $product, $imageType) } /** + * Get configurable options ids. + * * @param array $attributeData * @return array * @since 100.0.3 @@ -456,8 +467,8 @@ protected function getRendererTemplate() } /** + * @inheritDoc * @deprecated 100.1.5 Now is used _toHtml() directly - * @return string */ protected function getHtmlOutput() { @@ -465,6 +476,8 @@ protected function getHtmlOutput() } /** + * Get media callback url. + * * @return string */ public function getMediaCallback() diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index fd383e00789be..ae5014f77254d 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -753,9 +753,9 @@ define([ $widget.options.jsonConfig.optionPrices ]); - const checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId].additional_data); + var checkAdditionalData = JSON.parse(this.options.jsonSwatchConfig[attributeId]['additional_data']); - if (checkAdditionalData.update_product_preview_image == 1) { + if (1 == checkAdditionalData['update_product_preview_image']) { $widget._loadMedia(); }