Skip to content

Commit a76509b

Browse files
author
lestare
committed
MAGETWO-65248: [Backport] - [Performance] Caching of swatches data in block cache - for 2.1.6
1 parent 142e72a commit a76509b

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,8 @@ protected function getConfigurableOptionsIds(array $attributeData)
365365
}
366366

367367
/**
368-
* Return HTML code
368+
* Produce and return block's html output.
369369
*
370-
* @codeCoverageIgnore
371370
* @return string
372371
*/
373372
protected function _toHtml()

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,29 @@ protected function getRendererTemplate()
2222
}
2323

2424
/**
25+
* Produce and return block's html output.
26+
*
27+
* @return string
28+
*/
29+
protected function _toHtml()
30+
{
31+
$output = '';
32+
if ($this->isProductHasSwatchAttribute) {
33+
$output = parent::_toHtml();
34+
}
35+
36+
return $output;
37+
}
38+
39+
/**
40+
* @deprecated
2541
* @return string
2642
*/
2743
protected function getHtmlOutput()
2844
{
2945
$output = '';
3046
if ($this->isProductHasSwatchAttribute) {
31-
$output = parent::toHtml();
47+
$output = parent::getHtmlOutput();
3248
}
3349

3450
return $output;

0 commit comments

Comments
 (0)