I am using Magento 2.2.7. From Admin panel product page shows more than 70k records. But when I try to get product count in a block by

$collection = $this->_productFactory->create()->getCollection()->count();

it shows only 10k count. Why the missmatch come?


Try This :-

$productCount = count($this->_productFactory->create()->getCollection()->getData());
| improve this answer | |
  • How I set in _prepareCollection() since only collection doesnot give all the rows. – Iftakharul Alam Apr 12 '19 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.