Get product Stock in Magento 2
Posted by navaneeth on Jun 24, 2017 in General, Magento 2 | No comments yet
In this post we are discussing on how to get the product stock qty in magento 2.
$productID = 100;
$websiteID = 1;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface');
echo $StockState->getStockQty($productID, $websiteID);

Leave a Reply