Add to cart quantity dynamic

I have AJAX add to cart with input field where the quantity is.

If i put in the shop page quantity on 30 and add to cart it only adds 1 because of the code above^. How can I make this dynamic by saying add to cart of howmany is filled in the .qty field

Full code:
quantity-input.php

functions.php