Magento – Magento 2: All Products Not Displaying In Admin

attributesfilterlayered-navigationmagento2

I have more than 5K products. Suddenly don't know what happen now on Admin Side

In Admin -> Products -> Catalog now it's displaying only 1K products.

All Filters are also Reset. Visibility All Ok for Product.

When i Export from Admin .CSV file has 5K products. On Frontend also it's displaying 5K products.

Done with Indexing & Caching. Check Product Status as Well.

Don't know where is the issue?

[UPDATE]

I have delete all records & import it again. It's working fine now 🙂

Best Answer

Check SQL statement to get totals count. Change method \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory::create from

public function create(array $data = array())
{
    return $this->_objectManager->create($this->_instanceName, $data);
}

to

public function create(array $data = [])
{
    $collection = $this->_objectManager->create($this->_instanceName, $data);
    $sql = (string)$collection->getSelectCountSql();
    $logger = $this->_objectManager->get(\Psr\Log\LoggerInterface::class);
    $logger->alert($sql);
    return $collection;
}

then refresh your product grid and find SQL statement in the log (.../var/log/debug.log).

Related Topic