Hi nabilabolo,
For checking the availability you need to check the item from stock table. If the selected quantity for particular item is greater than the stock then you have to show the message.
I would request to try at your end and then report back if any problem.