How can I alter an "Add to cart" button at the submission time?
You can use the form alter as follows:

function hook_form_alter(&amp;$form, &amp;$form_state, $form_id) { //hook can be replaced by theme name if being defined in *template.php* of a theme and by the module name if function is being defined inside a custom module

  if($form_id == 'commerce_cart_add_to_cart_form') {

//HERE YOU CAN DEFINE A SUBMIT HANDLER, WHICH WILL ACT ON HITTING ADD TO CART BUTTON. Example:

    $form['#submit'][] = 'custom_submit';
  }


function custom_submit($form, &amp;$form_state) { //custom submit handler

  //Add here the functionality you want to do on click of add to cart button

}