How to get and update stock status in Magento 2.3 MSI
The Old Way The old way of getting stock info from Magento 2 was using stockRegistry and it would output or input an array. $productRepository = $objectManager->get(‘\Magento\Catalog\Api\ProductRepositoryInterface’); $stockRegistry = $objectManager->create(‘\Magento\CatalogInventory\Api\StockRegistryInterface’); $sku=”STARTNET_ITEM_123″; $product=$productRepository->get($sku); $stockdata = $stockRegistry->getStockStatus($product->getId(), 1); // for store id