title: Change quantity input field to a Dropdown in WooCommerce
body: <p>I'm using the following in function.php and it works great on a single product page.  The issue I have is on the cart page when you choose a different quantity it doesn't automatically update the cart.  Any ideas?</p>
  <pre><code>function woocommerce_quantity_input( $args = array(), $product = null, $echo = true ) {
    
     if ( is_null( $product ) ) {
        $product = $GLOBALS['product'];
     }
   
     $defaults = array(
        'input_id' =&gt; uniqid( 'quantity_' ),
        'input_name' =&gt; 'quantity',
        'input_value' =&gt; '1',
        'classes' =&gt; apply_filters( 'woocommerce_quantity_input_classes', array( 'input-text', 'qty', 'text' ), $product ),
        'max_value' =&gt; apply_filters( 'woocommerce_quantity_input_max', -1, $product ),
        'min_value' =&gt; apply_filters( 'woocommerce_quantity_input_min', 0, $product ),
        'step' =&gt; apply_filters( 'woocommerce_quantity_input_step', 1, $product ),
        'pattern' =&gt; apply_filters( 'woocommerce_quantity_input_pattern', has_filter( 'woocommerce_stock_amount', 'intval' ) ? '[0-9]*' : '' ),
        'inputmode' =&gt; apply_filters( 'woocommerce_quantity_input_inputmode', has_filter( 'woocommerce_stock_amount', 'intval' ) ? 'numeric' : '' ),
        'product_name' =&gt; $product ? $product-&gt;get_title() : '',
     );
   
     $args = apply_filters( 'woocommerce_quantity_input_args', wp_parse_args( $args, $defaults ), $product );
    
     // Apply sanity to min/max args - min cannot be lower than 0.
     $args['min_value'] = max( $args['min_value'], 0 );
     // Change 6 to max quantity
     $args['max_value'] = 0 &lt; $args['max_value'] ? $args['max_value'] : 6;
   
     // Max cannot be lower than min if defined.
     if ( '' !== $args['max_value'] &amp;&amp; $args['max_value'] &lt; $args['min_value'] ) {
        $args['max_value'] = $args['min_value'];
     }
    
     $options = '';
      
     for ( $count = $args['min_value']; $count &lt;= $args['max_value']; $count = $count + $args['step'] ) {
   
        // Cart item quantity defined?
        if ( '' !== $args['input_value'] &amp;&amp; $args['input_value'] &gt;= 1 &amp;&amp; $count == $args['input_value'] ) {
          $selected = 'selected';      
        } else $selected = '';
   
        $options .= '&lt;option value=&quot;' . $count . '&quot;' . $selected . '&gt;' . $count . '&lt;/option&gt;';
   
     }
       
     $string = '&lt;div class=&quot;quantity&quot;&gt;&lt;span&gt;Qty&lt;/span&gt;&lt;select name=&quot;' . $args['input_name'] . '&quot;&gt;' . $options . '&lt;/select&gt;&lt;/div&gt;';
   
     if ( $echo ) {
        echo $string;
     } else {
        return $string;
     }
    
  } 
  </code></pre>