I have install Magento 2.1.3
with Porto Theme
.
In category page, Few sub category display proper with products count and Faw doesn't appare/display but it has product.
I tried to disable all custom modules and tried to disable Porto Theme
but not display other sub-categories.
Following file from vendor/magento/module-catalog-search/Model/Layer/Filter/Category.php
protected function _getItemsData()
{
/** @var \Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection $productCollection */
$productCollection = $this->getLayer()->getProductCollection();
$optionsFacetedData = $productCollection->getFacetedData('category');
$category = $this->dataProvider->getCategory();
$categories = $category->getChildrenCategories();
$collectionSize = $productCollection->getSize();
if ($category->getIsActive()) {
foreach ($categories as $category) {
if ($category->getIsActive()
&& isset($optionsFacetedData[$category->getId()])
&& $this->isOptionReducesResults($optionsFacetedData[$category->getId()]['count'], $collectionSize)
) {
$this->itemDataBuilder->addItemData(
$this->escaper->escapeHtml($category->getName()),
$category->getId(),
$optionsFacetedData[$category->getId()]['count']
);
}
}
}
I debug above code and found that, $this->isOptionReducesResults($optionsFacetedData[$category->getId()]['count'], $collectionSize)
getting blank so that sub-categories
not showing.