Skip to content

Commit 142e72a

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

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -365,30 +365,18 @@ protected function getConfigurableOptionsIds(array $attributeData)
365365
}
366366

367367
/**
368-
* Produce and return block's html output
368+
* Return HTML code
369369
*
370370
* @codeCoverageIgnore
371371
* @return string
372372
*/
373-
public function toHtml()
373+
protected function _toHtml()
374374
{
375375
$this->initIsProductHasSwatchAttribute();
376376
$this->setTemplate(
377377
$this->getRendererTemplate()
378378
);
379-
380-
return parent::toHtml();
381-
}
382-
383-
/**
384-
* Return HTML code
385-
*
386-
* @codeCoverageIgnore
387-
* @return string
388-
*/
389-
protected function _toHtml()
390-
{
391-
return $this->getHtmlOutput();
379+
return parent::_toHtml();
392380
}
393381

394382
/**
@@ -402,6 +390,7 @@ protected function getRendererTemplate()
402390
}
403391

404392
/**
393+
* @deprecated
405394
* @codeCoverageIgnore
406395
* @return string
407396
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function getHtmlOutput()
2828
{
2929
$output = '';
3030
if ($this->isProductHasSwatchAttribute) {
31-
$output = parent::getHtmlOutput();
31+
$output = parent::toHtml();
3232
}
3333

3434
return $output;

0 commit comments

Comments
 (0)