I'm searching the way to preload quantity of each simple product on configurable product detail page. The reason is I want to dynamically show to client "In Stock", "Out of stock" or "Only 1 left" notification for each size+color config which was selected by client.
P.S.: I used color swatches as dropdown and I saw one hidden field which was dynamically change with selected simple product ID. But then I changed to text swatch+image swatch and this field no more changing.
Can anybody show example how to implement this functionality in Magento 2? Thank you