/** * @return void */ protected function prepareCollection() { $storeId = $this->storeManager->getStore()->getId(); $this->categoryCollection->addAttributeToSelect('name')->addAttributeToSelect('is_active')->setProductStoreId($storeId)->setLoadProductCount(true)->setStoreId($storeId); }