Skip to content

Commit edabf90

Browse files
committed
Merge remote-tracking branch 'github-magento2ce/MC-5906' into EPAM-PR-41
2 parents f9394af + 1675f7b commit edabf90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/code/Magento/Rule/Model/Condition/Sql/Builder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,23 @@ public function attachConditionToCollection(
252252
if (!empty($whereExpression)) {
253253
if (!empty($combine->getConditions())) {
254254
$conditions = '';
255-
$attribute = '';
255+
$attributeField = '';
256256
foreach ($combine->getConditions() as $condition) {
257257
if ($condition->getData('attribute') === \Magento\Catalog\Api\Data\ProductInterface::SKU) {
258258
$conditions = $condition->getData('value');
259-
$attribute = $condition->getData('attribute');
259+
$attributeField = $condition->getMappedSqlField();
260260
}
261261
}
262262

263263
$collection->getSelect()->where($whereExpression);
264264

265-
if (!empty($conditions) && !empty($attribute)) {
265+
if (!empty($conditions) && !empty($attributeField)) {
266266
$conditions = explode(',', $conditions);
267267
foreach ($conditions as &$condition) {
268268
$condition = "'" . trim($condition) . "'";
269269
}
270270
$conditions = implode(', ', $conditions);
271-
$collection->getSelect()->order("FIELD($attribute, $conditions)");
271+
$collection->getSelect()->order("FIELD($attributeField, $conditions)");
272272
}
273273
} else {
274274
// Select ::where method adds braces even on empty expression

0 commit comments

Comments
 (0)