Skip to content

Commit aeb441b

Browse files
author
Valeriy Nayda
committed
MAGETWO-65099: [Performance] Optimize validation of swatches attributes
1 parent 34bb0ae commit aeb441b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ protected function initIsProductHasSwatchAttribute()
224224
}
225225

226226
/**
227+
* Check that product has at least one swatch attribute
228+
*
227229
* @return bool
228230
*/
229231
protected function isProductHasSwatchAttribute()
@@ -413,7 +415,10 @@ protected function _toHtml()
413415
}
414416

415417
/**
416-
* @codeCoverageIgnore
418+
* Return renderer template
419+
*
420+
* Template for product with swatches is different from product without swatches
421+
*
417422
* @return string
418423
*/
419424
protected function getRendererTemplate()

app/code/Magento/Swatches/Model/SwatchAttributeCodes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private function loadSwatchAttributeCodes()
9999
]
100100
)->where(
101101
'a.attribute_id IN (?)',
102-
new \Zend_Db_Expr(sprintf('(%s)', $this->getAttributeIdsSelect()))
102+
(string)$this->getAttributeIdsSelect()
103103
);
104104
$result = $this->resourceConnection->getConnection()->fetchPairs($select);
105105
return $result;

0 commit comments

Comments
 (0)