Mixing attributes and line item fields in Drupal Commerce Add To Cart form
You may find it easier to organize the form elements in a form template.

e.g

/**
 * Implements hook_form_FORM_ID_alter().
 */
function MYMODULE_form_commerce_cart_add_to_cart_form_alter(&amp;$form, &amp;$form_state{
  $form['#theme'] = array('commerce_add_to_cart_form');
}

/**
 * Implements hook_theme().
 */
function MYMODULE_theme($existing, $type, $theme, $path){
  return array(
    'commerce_add_to_cart_form' =&gt; array(
      'render element' =&gt; 'form',
      'template' =&gt; 'form--commerce_add_to_cart',
      'path' =&gt; $path . '/templates',
    ),
  );
}


Then you can use a file in 

MYTHEME/templates/form--commerce_add_to_cart.tpl.php


and in the template file

print drupal_render($form['element_name']);
// or
print drupal_render_children($form['element_name']);


to specify exactly where to render each form element.