In my Magento store I sometimes forget to select 'In Stock' from the dropdown after adding new inventory to an out of stock item.
Is it possible to somehow get a list of all products which have inventory but as tagged as "Out of Stock"?
To show Magento 2 product that is out of stock status you need to do the following: Log in to the Admin Panel and go to Stores>Configuration>Catalog>Inventory. Open the Stock Options dropdown. Set Yes in the Display Out of Stock Products option if you want to display out-of-stock products in your Magento 2 store.
Use the Magento\CatalogInventory\Api\StockRegistryInterface class to fetch product stock status. Call method with a required parameter, $productId = 1; echo $result = $this->getStockStatus($productId); A result will be true if product qty greater than 0 or Stock Status set to In stock from the admin panel.
Inventory Management for Adobe Commerce and Magento Open Source gives you the tools to manage your product inventory. Merchants with a single store to multiple warehouses, stores, pickup locations, drop shippers, and more can use these features to maintain quantities for sales and handle shipments to complete orders.
If you are able to script something real quick.
$products = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToFilter('is_in_stock', 0)
->addAttributeToFilter('qty', array("gt" => 0));
Sadly I can't seem to remember how to put in the >0 in a way that is supposed to work. Maybe someone can comment on that.
What you can do with $products is run it through a foreach loop and then set the is_in_stock to the value of 1 and you should be in business.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With