Adding validation to commerce pane form I want to add validation to the user's details form.

I've tried to use the #validate to add validation function, but nothing happens.

This is the Code:

function hotphone_checkout_form_commerce_checkout_form_checkout_alter(&amp;$form,&amp;$form_state)
{
 $form['#validate'][] = 'mymodule_validate_check';
}

function mymodule_validate_check(&amp;$form, &amp;$form_state) 
{
  dpm('hererere', $form_state);
  die();
}


What am i doing wrong??
The current way to do this, as per Commerce API is, instead of adding a validate handler to the complete checkout form you extend the checkout pane definition and specify your own validate handler.

If your custom validation passes, fallback to the default  pane validation handler.

In this example, to add a custom validation handler to the shipping pane:

/**
 * Implements hook_commerce_checkout_pane_info_alter
 */
function MODULE_commerce_checkout_pane_info_alter(&amp;$checkout_panes) {
  if(isset($checkout_panes['commerce_shipping'])){
    $checkout_panes['commerce_shipping']['callbacks']['checkout_form_validate'] = 'MODULE_commerce_shipping_pane_validate';
  }
}

/**
 * Checkout pane validation override to ensure valid shipping method for address
 */
function MODULE_commerce_shipping_pane_validate(&amp;$form, &amp;$form_state, $checkout_pane, $order) {

  // Do some validation tests here... omitted for brevity.
  if (!$valid) {
    drupal_set_message(t('Some validation error message'), 'warning');
    return FALSE;
  }

  // Fallback to default validator.
  if (function_exists('commerce_shipping_pane_checkout_form_validate')) {
    return commerce_shipping_pane_checkout_form_validate($form, $form_state, $checkout_pane, $order);
  } else {
    // Passed validation.
    return TRUE;
  }

}



  checkout_form_validate($form, &amp;$form_state, $checkout_pane, $order):
  validates data inputted via the pane’s elements on the checkout form
  and returns TRUE or FALSE indicating whether or not all the data
  validated


More info: 


hook_commerce_checkout_pane_info
commerce_checkout_form_validate