Drupal commerce change quantity textfield in cart view to selectbox Is there a way to change the quantity widget in the Drupal Commerce cart view from a textfield to a selectbox? And then refresh the page when the selectbox is changed without making the user press the Update cart button?
&lt;?php
/**
 * Implements hook_form_alter().
*/
function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 if (strpos($form_id, 'commerce_cart_add_to_cart_form_') === 0) {
   if (isset($form['quantity']) &amp;&amp; ($form['quantity']['#type'] == 'textfield')) {
     $form['quantity']['#type'] = 'select';
     $form['quantity']['#options'] = drupal_map_assoc(range(1,10));
     $form['quantity']'#default_value' =&gt; 1,
   }
 }
}


?>