If the piece is greater than available qty it pops up an error message which is shown in the picture but if I order 1000 pieces which is greater than available qty it will get the total
P.S. the product, price, and avail qty are coming from database
See picture below also