From 46800f65f964d6a8b66094ae60fda547638e846e Mon Sep 17 00:00:00 2001 From: Mayank Date: Fri, 13 Oct 2017 18:19:11 +0530 Subject: [PATCH 1/2] Magento 2.2.0 Product Repeat Isuue after filter on category listing page.Issue : #11139 --- .../Catalog/Block/Product/ProductList/Toolbar.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php index 25daf8b3a108c..71255fa683632 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php @@ -190,7 +190,14 @@ public function setCollection($collection) $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; } From b3ab1751a6a826c665b02d509ceb751f183cd641 Mon Sep 17 00:00:00 2001 From: Mayank Date: Mon, 16 Oct 2017 10:14:36 +0530 Subject: [PATCH 2/2] Redundant round brackets removed from Magento 2.2.0 layer navigation return no products when 2 filters selected. --- app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php index 71255fa683632..24b5f70f0edb0 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php @@ -190,7 +190,7 @@ public function setCollection($collection) $this->_collection->setPageSize($limit); } if ($this->getCurrentOrder()) { - if (($this->getCurrentOrder()) == 'position') { + if ($this->getCurrentOrder() == 'position') { $this->_collection->addAttributeToSort( $this->getCurrentOrder(), $this->getCurrentDirection()