File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
app/code/Magento/Rule/Model/Condition/Sql Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -252,23 +252,23 @@ public function attachConditionToCollection(
252
252
if (!empty ($ whereExpression )) {
253
253
if (!empty ($ combine ->getConditions ())) {
254
254
$ conditions = '' ;
255
- $ attribute = '' ;
255
+ $ attributeField = '' ;
256
256
foreach ($ combine ->getConditions () as $ condition ) {
257
257
if ($ condition ->getData ('attribute ' ) === \Magento \Catalog \Api \Data \ProductInterface::SKU ) {
258
258
$ conditions = $ condition ->getData ('value ' );
259
- $ attribute = $ condition ->getData ( ' attribute ' );
259
+ $ attributeField = $ condition ->getMappedSqlField ( );
260
260
}
261
261
}
262
262
263
263
$ collection ->getSelect ()->where ($ whereExpression );
264
264
265
- if (!empty ($ conditions ) && !empty ($ attribute )) {
265
+ if (!empty ($ conditions ) && !empty ($ attributeField )) {
266
266
$ conditions = explode (', ' , $ conditions );
267
267
foreach ($ conditions as &$ condition ) {
268
268
$ condition = "' " . trim ($ condition ) . "' " ;
269
269
}
270
270
$ conditions = implode (', ' , $ conditions );
271
- $ collection ->getSelect ()->order ("FIELD( $ attribute , $ conditions) " );
271
+ $ collection ->getSelect ()->order ("FIELD( $ attributeField , $ conditions) " );
272
272
}
273
273
} else {
274
274
// Select ::where method adds braces even on empty expression
You can’t perform that action at this time.
0 commit comments