// Get Categories to Show in Layered Nav diff --git a/app/code/Amasty/Shopby/Model/Layer/Filter/Category.php b/app/code/Amasty/Shopby/Model/Layer/Filter/Category.php index bbffc93..27725da 100644 --- a/app/code/Amasty/Shopby/Model/Layer/Filter/Category.php +++ b/app/code/Amasty/Shopby/Model/Layer/Filter/Category.php @@ -608,9 +608,9 @@ class Category extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter $isCurrentCategory = !$this->isRenderAllTree() && ($isCurrentLevelMultiselect || $this->getCategoriesTreeDept() == self::MIN_CATEGORY_DEPTH); - $categoryId = $isCurrentCategory && $parentCategory->getIsAnchor() + $categoryId = $isCurrentCategory && $parentCategory->getIsAnchor() && $parentCategory->getId() != 2 ? $parentCategory->getId() - : $this->getRootCategory()->getId(); + : $this->getLayer()->getCurrentCategory()->getId(); return (int) $categoryId; }