2

I have Magento 2.3.0 installed on server with MSI package upgraded to v1.1.

I have configurable products with their child products initially in stock.

Once all the child products goes out of stock, Configurable product becomes out of stock (which is expected behaviour). However, when any of the child product is back in stock (this includes re-indexing all the indices), the configurable product still shows out of stock(expected to become in-stock).

Is it a bug or by default Magento design?

Is there any fix to achieve what I want?

0

This is the native behavior (and it's ok like this, because there are cases when you maybe want the product to appear out of stock).

You will have to update the parent product by hand or create a cronjob which checks if at least one of the childrens is in stock and set the proper stock status on the parent product.

2
  • Is there any ready cron code available or any kind of script that does that? – Nausif Apr 17 at 5:27
  • nope, there isn't any native functionality, you will have to build your own code for this. – Diana Botean Apr 18 at 12:40
0

Here I am not providing code block that you are looking at but as I understand, your stock management is at child level and one of the workaround is to mark 'manage stock' as NO for the configurable products so that such issues does not arises. And moreover, whole logic around add to cart or out of stock status can be displayed based on children product's stock status.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.