Skip to content

Commit 1d998f9

Browse files
author
Mayank
committed
Magento 2.2.0 Product Repeat Isuue after filter on category listing page.Issue : #11139
1 parent 0c0393d commit 1d998f9

File tree

1 file changed

+8
-1
lines changed
  • app/code/Magento/Catalog/Block/Product/ProductList

1 file changed

+8
-1
lines changed

app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ public function setCollection($collection)
192192
$this->_collection->setPageSize($limit);
193193
}
194194
if ($this->getCurrentOrder()) {
195-
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
195+
if (($this->getCurrentOrder()) == 'position') {
196+
$this->_collection->addAttributeToSort(
197+
$this->getCurrentOrder(),
198+
$this->getCurrentDirection()
199+
)->addAttributeToSort('entity_id', $this->getCurrentDirection());
200+
} else {
201+
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
202+
}
196203
}
197204
return $this;
198205
}

0 commit comments

Comments
 (0)