Does it have some inbuilt functionality already, or should I work with hooks or even subscriber to achieve this?


I solved this issue by using commerce stock module

You also need to select enforce option so that "add to cart" will automatically be disabled when stock drops to 0. Then you can use hook to hide the cart and show your own option.

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