Woocommerce minimum quantity

Put this code in your functions.php. This snippet does not allow customers to purchase a product with quantity lower than 2.