From 063514b9745c0c3eba77638282ebf0de336dd37e Mon Sep 17 00:00:00 2001 From: Didier Berlioz Date: Wed, 18 Oct 2017 16:19:11 +0200 Subject: [PATCH] Fix category id retrieval --- app/code/Magento/Catalog/Block/Product/ListProduct.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index e0a5f46573688..d6328e302a312 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -104,7 +104,7 @@ protected function _getProductCollection() // if the product is associated with any category if ($categories->count()) { // show products from this category - $this->setCategoryId(current($categories->getIterator())); + $this->setCategoryId(current($categories->getIterator())->getId()); } }