How can I manage stock by product options?

Hi, I currently have a problem that I don’t seem to find the solution for.

I need to manage stock by product options, lets say that I have an outfit product with jacket size and pants size, how do I manage the stock in a way that any size of jacket have its own a stock and every size of pants also have its own but separated from the other. The behavior that I try to achieve is that when a jacket size S is out of stock all product combinations with jacket S are also out of stock, or if pants size L are out of stock any combination with that option is also out of stock.

I hope that I explained the question clearly. Any help would be appreciated.

hmm sounds like you may need a custom app for this.

How are you currently handling product combinations?

Thanks for the response.

Currently I use the traditional way of handling product options but the problem is that it doesn’t let me keep track of the stock correctly. Any ideas of how the logic of the custom app must be to achieve this?

Thank you in advance.