Sometimes it happens that you have associated products (Product configurations) in a configurable product but it shows ‘Out of stock’ on front-end despite that you have reindexed your Magento 2 and flushed the system cache as well.
Do the following If you experience the same issues:
- Whilst creating tte product configurations, make sure all configurations have the quantity assigned to them.
- If you do not assign the quantity at this stage then Magento2 will assume that the product is not in stock and it will change the stock status for all configurations to ‘Out of Stock’
- If you did not specify quantity for the configurations then you’d have to do so and change the status of all of the configurations from ‘Out of stock’ to ‘In Stock’ MANUALLY by going to the individual product editor.
- Once you have updated the stock status of the configurations, clear cache and reindex (Click here to learn how to reindex Magento2) Magento.
- Go back to the frontend product page, refresh the website and everything will be back to normal.