I am trying to get all the products from the collection(both in stock and out of stock) but with no luck at all. The setting on admin needs to hide the out of stock products from frontend but I want to show them in a specific page.
This is my code:
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection'); $productCollection->addAttributeToSelect('*'); $productCollection->load();
This brings the in stock products only. How can I modify it to bring and the out of stock as well?
Thanks