I have been trying unsuccessfully to obtain the current inventory numbers of configurable products for use on the product page. Though it may not be the best way, I was able to retrieve it for basic products with the block class 'Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Inventory'. Does anyone have a solution to this problem or is this something I would need to write a custom module for?
Solved! Go to Solution.
The current stock qty; so, for example, I currently have 217 Joust Duffle Bags in stock. I want to be able to test that number against the user inputted number in the QTY input on the product page against the current inventory number before the user clicks add to cart.