Skip to content

Commit eaaf316

Browse files
committed
ACP2E-1307: addressed PR comments
1 parent 9af451a commit eaaf316

File tree

1 file changed

+5
-4
lines changed
  • app/code/Magento/CatalogWidget/Model/Rule/Condition

1 file changed

+5
-4
lines changed

app/code/Magento/CatalogWidget/Model/Rule/Condition/Product.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
use Magento\Catalog\Model\ProductCategoryList;
1313
use Magento\Catalog\Model\ResourceModel\Product\Collection;
1414
use Magento\Framework\DB\Select;
15-
use Magento\Framework\Exception\LocalizedException;
1615
use Magento\Store\Model\Store;
17-
use Zend_Db_Select_Exception;
1816

1917
/**
2018
* Rule product condition data model
@@ -249,8 +247,11 @@ protected function addNotGlobalAttribute(
249247
$conditionCheck = $connection->quoteIdentifier($aliasStore . '.value_id') . " > 0";
250248
$conditionTrue = $connection->quoteIdentifier($aliasStore . '.value');
251249
$conditionFalse = $connection->quoteIdentifier($aliasDefault . '.value');
252-
$ifSql = "IF ($conditionCheck, $conditionTrue, $conditionFalse)";
253-
$joinedAttribute = new \Zend_Db_Expr($ifSql);
250+
$joinedAttribute = $collection->getSelect()->getConnection()->getCheckSql(
251+
$conditionCheck,
252+
$conditionTrue,
253+
$conditionFalse
254+
);
254255
} else {
255256
$joinedAttribute = $aliasStore . '.' . 'value';
256257
}

0 commit comments

Comments
 (0)