Skip to content
Snippets Groups Projects
Commit 1d998f9c authored by Mayank's avatar Mayank
Browse files

Magento 2.2.0 Product Repeat Isuue after filter on category listing page.Issue : #11139

parent 0c0393d4
Branches
No related merge requests found
......@@ -192,7 +192,14 @@ class Toolbar extends \Magento\Framework\View\Element\Template
$this->_collection->setPageSize($limit);
}
if ($this->getCurrentOrder()) {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
if (($this->getCurrentOrder()) == 'position') {
$this->_collection->addAttributeToSort(
$this->getCurrentOrder(),
$this->getCurrentDirection()
)->addAttributeToSort('entity_id', $this->getCurrentDirection());
} else {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}
}
return $this;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment