I am using Magento 2.2.7. On custom product grid _prepareCollection()
I tried to get all product collection by
$collection = $this->_productFactory->create()->getCollection();
but it gets only enabled
& in_stock
products. If I get count($collection->getData())
it shows all product count. but If I tried with $collection->count()
it get only enabled
and in_stock
product count. How I get all products in grid through $this->setCollection($collection);
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory
out_of_stock
anddisabled
product. But why can you help in this regard?Magento\CatalogInventory\Model\AddStockStatusToCollection::beforeLoad()
) shouldn't be implied!