Hi,
There is no option for that. Doing it would require developing a plugin to cancel the add to cart when the quantity requested exceeds the stock.
There are three things which might help you besides developing a custom plugin :
- in each product, you have the "quantity input" setting which allows you to restrict what the customer can choose to add to the cart if set to "show select". So that would make it impossible for someone to add a few hundred products at once.
- In each product, you can use the "quantity per order" setting to set a maximum of quantity purchasable per order. So if you set 20 in there, this limitation will kick in unless the stock is below 20. So if you have a product you have a lot of stock of and people normally don't purchase more than a few, this would allow you to prevent them from discovering the stock.
- You could change the text of the error message "The maximum quantity possible for that product is %s" with a translation override and remove the %s. For example, you could have instead the text "You tried to add too much quantity. The quantity of the product in the cart has been automatically reduced to the maximum authorized". That way, it doesn't tell the customer that the whole stock is in the cart, nor what the amount of the total stock is.