We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f7fcf6 commit 1e105b3Copy full SHA for 1e105b3
app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php
@@ -192,7 +192,11 @@ public function setCollection($collection)
192
$this->_collection->setPageSize($limit);
193
}
194
if ($this->getCurrentOrder()) {
195
- $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
+ if (($this->getCurrentOrder()) == 'position') {
196
+ $this->_collection->addAttributeToSort($this->getCurrentOrder(), $this->getCurrentDirection())->addAttributeToSort('entity_id', $this->getCurrentDirection());
197
+ } else {
198
+ $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
199
+ }
200
201
return $this;
202
0 commit comments