By default magento filters only in stock products in collection. We have to set the in stock filter as false.$productCollection = $_objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory'); $collection = $productCollection->create()->setFlag('has_stock_status_filter', false)->load();
Comments
Perfect solution!
ReplyDelete