Show Available Stock quantity for each product in Magento 2

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $StockState = $objectManager->get('\Magento\CatalogInventory\Api\StockStateInterface'); echo $StockState->getStockQty($product->getId(), $product->getStore()->getWebsiteId()); ?> Reference: https://magento.stackexchange.com/a/97952/32283

February 9, 2018 · 1 min · Harshvardhan Malpani