Skip to content

Commit 1e105b3

Browse files
author
Mayank
committed
Product Repeat Isuue after filter on category listing page.Issue : #11139
1 parent 5f7fcf6 commit 1e105b3

File tree

1 file changed

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

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ 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($this->getCurrentOrder(), $this->getCurrentDirection())->addAttributeToSort('entity_id', $this->getCurrentDirection());
197+
} else {
198+
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
199+
}
196200
}
197201
return $this;
198202
}

0 commit comments

Comments
 (0)