We all know that woocommerce is very useful plugin for wordpress shopping website. Sometimes we need to customize it as per our requirement. In the same reference we know that we have text fields for quantity input at product detail page, cart page etc.

Generally user prefer dropdown to select quantity in place of textbox. It is more perfect for website owners in a way to get exact input from users. To make it easy, we need to follow few simple steps in our current theme. Steps are as follows :

1 .Just copy below mentioned code and paste it in a new file :

<?php
/**
 * Product quantity inputs
 *
 * @author  WooThemes
 * @package WooCommerce/Templates
 * @version 2.4.7
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

global $product;

$defaults = array(
	'max_value'   => apply_filters( 'woocommerce_quantity_input_max', '', $product ),
	'min_value'   => apply_filters( 'woocommerce_quantity_input_min', '', $product ),
	'step'        => apply_filters( 'woocommerce_quantity_input_step', '1', $product ),
);

if ( ! empty( $defaults['min_value'] ) )
	$min = $defaults['min_value'];
else $min = 1;

if ( ! empty( $defaults['max_value'] ) )
	$max = $defaults['max_value'];
else $max = 10;

if ( ! empty( $defaults['step'] ) )
	$step = $defaults['step'];
else $step = 1;

?>
<div class="quantity_select">
	<select name="<?php echo esc_attr( $input_name ); ?>" title="<?php _ex( 'Qty', 'Product quantity input tooltip', 'woocommerce' ) ?>" class="qty">
	<?php
	for ( $count = $min; $count <= $max; $count = $count+$step ) {
		if ( $count == $input_value )
			$selected = ' selected';
		else $selected = '';
		echo '<option value="' . $count . '"' . $selected . '>' . $count . '</option>';
	}
	?>
	</select>
</div>

2. Save that file and name it “quantity-input.php”
3. Paste this file in your woocommerce folder “yourthemefolder/woocommerce/global/quantity-input.php”
4. Its done.

Above code will work perfectly and replace textbox for quantity into dropdown everywhere in your website. This code will override all your woocommerce default functions written for quantity input. After applying this code your cart will update with quantity dropdown seems like below image.
quantitly

As the cart page, it will replace the quantity field everywhere it exists on website. I have used the code which is mentioned here. Tested this with my current theme and woocommerce and modified it a bit, it is working fine. I have shared it here in a different way so that anyone can use it perfectly.