Skip to content

Commit 6166648

Browse files
authored
Fixed price expression SQL in layered navigation (#3227)
1 parent 6b683d7 commit 6166648

File tree

1 file changed

+2
-2
lines changed
  • app/code/core/Mage/Catalog/Model/Resource/Layer/Filter

1 file changed

+2
-2
lines changed

app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ public function loadPrices($filter, $limit, $offset = null, $lowerPrice = null,
309309
if (!is_null($upperPrice)) {
310310
$select->where("$priceExpression < " . $this->_getComparingValue($upperPrice, $filter));
311311
}
312-
$select->order("$priceExpression ASC")->limit($limit, $offset);
312+
$select->order(new Zend_Db_Expr("$priceExpression ASC"))->limit($limit, $offset);
313313

314314
return $this->_getReadAdapter()->fetchCol($select);
315315
}
@@ -372,7 +372,7 @@ public function loadNextPrices($filter, $price, $rightIndex, $upperPrice = null)
372372
if (!is_null($upperPrice)) {
373373
$pricesSelect->where("$priceExpression < " . $this->_getComparingValue($upperPrice, $filter));
374374
}
375-
$pricesSelect->order("$priceExpression DESC")->limit($rightIndex - $offset + 1, $offset - 1);
375+
$pricesSelect->order(new Zend_Db_Expr("$priceExpression DESC"))->limit($rightIndex - $offset + 1, $offset - 1);
376376

377377
return array_reverse($this->_getReadAdapter()->fetchCol($pricesSelect));
378378
}

0 commit comments

Comments
 (0)