是否有Ubercart模块要求用户在结帐页面中插入两次电子邮件?
答案 0 :(得分:2)
ubercart结帐设置中有一个电子邮件确认复选框。无需额外的模块。
答案 1 :(得分:1)
我怀疑是否有一个模块。您可以在自定义模块中使用hook_form_alter
执行此操作。应该只有10到20行代码。
像
这样的东西function module_form_FORM_ID_alter(&$form, &$form_state) {
$form['...']['second_mail'] = array(
'#title' => t('Verify E-mail'),
'#type' => 'textfield',
'#weight' => xx,
);
$form['#validate'][] = 'module_validate_function_name';
}
function module_validate_function_name(&$form, &$form_state) {
if ($form_state['values']['mail'] != $form_state['values']['second_mail']) {
form_set_error('second_mail', t('You have mistyped your e-mail, please verify');
}
}
以上是示例代码,但实际上可能有效,这取决于如何创建超级跑车结账表单,更具体地说,取决于其邮件字段的名称。
有一些空白,但应该很容易填写。
答案 2 :(得分:1)
我使用它来实现它:
/* Code to add confirm email for uc checkout */
function custom_code_form_alter(&$form, $form_state, $form_id) {
if($form_id == "uc_cart_checkout_form" && $form['panes']['customer']['primary_email']['#type'] != 'hidden'){
$form['panes']['customer']['primary_email']['#weight'] = '0';
$form['panes']['customer']['new_account']['#weight'] = '2';
$form['panes']['customer']['confirm_email'] = array(
'#title' => t('Verify E-mail address'),
'#type' => 'textfield',
'#size' => '32',
'#required' => true,
'#weight' => '1'
);
$form['#validate'][] = 'custom_code_validate_confirm_email';
}
}
function custom_code_validate_confirm_email(&$form, &$form_state){
if($form_state['values']['panes']['customer']['primary_email'] != $form_state['values']['panes']['customer']['confirm_email']) {
form_set_error('panes[customer][confirm_email', t('Email addresses must match.'));
}
}
/* end code for confirm_email */