Prevent anonymous to input a registered email during commerce checkout through Rules? In Drupal Commerce, how to prompt a warning message and keep it in checkout process if an anonymous inputs a registered email? I know there is a Commerce Checkout Login, but it is just an AJAX addon.

I believe I can do it through Rules and that's what I did.


Event: Process checkout pane
Conditions:

Data comparison: [commerce-order:uid] == 0
NOT Data value is empty: [commerce-order:mail]
Entity exists by property: User/Email, [commerce-order:mail]

Actions:

Show a message on the site: Warning, ...
Update checkout status: checkout



In first trial, it seems work well. But the weird thing is, when I change the email field to an unregistered one, I can still spot the warning message generated by Show a message on the site. Is there something wrong in my rule setup?

Refer to this Anonymous can use registered email address: intended behavior?.
With @RyanSzrama's suggestion, I pursue a form validation solution. What I finally use is to implement a hook_commerce_checkout_pane_info_alter. The following is a simplified code snippet for that.

/**
 * Implements hook_commerce_checkout_pane_info_alter
 */
function MYMODULE_commerce_checkout_pane_info_alter(&amp;$checkout_panes) {
  if(isset($checkout_panes['account'])){
    $checkout_panes['account']['callbacks']['checkout_form_validate'] = 'MYMODULE_form_validate';
  }
}

function MYMODULE_form_validate($form, &amp;$form_state, $checkout_pane, $order) {
  if (!user_is_logged_in()) {
    $mail = $form['account']['login']['mail']['#value'];
    $query = sprintf("SELECT COUNT(*) FROM {users} WHERE mail = '%s';", $mail);
    if (db_query($query)-&gt;fetchField()) {
      $msg = t('The email address is registered to an account!');
      form_set_error('[account][login][mail]', $msg);
      return FALSE;
    }
  }
  return TRUE;
}


Hope that also provides some hint or help to others. For form validation, please refer to Adding validation to commerce pane form.