As standard, a customer can enter their email address incorrectly (speeling mistoke) during the 'create account' process. This way they don't receive a welcome email and may cause further issues, if not spotted by an administrator/shop owner.
The code snippets here are shown for 2.0.25 but could be easily adapted for other releases. Also, the $HTTP_POST_VARS should really be replaced with $_POST (and may well be in your version of the files).
4 Steps
1. catalog/includes/languages/english.php (and any other languages in use). Add underneath existing email entries, or just before the last ?>
2. catalog/create_account.phpCode:define('ENTRY_EMAIL_CONFIRMATION', 'E-Mail Confirmation:'); define('ENTRY_EMAIL_CONFIRMATION_TEXT', '*'); define('ENTRY_EMAIL_ERROR_NOT_MATCHING', 'The E-mail Confirmation must match your E-mail Address.');
Look for
Replace with/addPHP Code:$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
3. Also, in catalog/create_account.phpPHP Code:$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
$email_confirmation = tep_db_prepare_input($HTTP_POST_VARS['email_confirmation']);
Look for
Modify it so it looks like this:PHP Code:$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
// PWA BOF 2b
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and guest_account != '1'");
// PWA EOF 2b
$check_email = tep_db_fetch_array($check_email_query);
if ($check_email['total'] > 0) {
$error = true;
(Note that last } will already exist.)PHP Code:$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
} else {
// PWA BOF 2b
$check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "' and guest_account != '1'");
// PWA EOF 2b
$check_email = tep_db_fetch_array($check_email_query);
if ($check_email['total'] > 0) {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
} elseif ($email_address != $email_confirmation) {
$error = true;
$messageStack->add('create_account', ENTRY_EMAIL_ERROR_NOT_MATCHING);
}
}
4. catalog/templates/your-template/content/create_account.tpl.php (copy with one from fallback, if needs be.)
Look for:
Directly below it add:PHP Code:<tr>
<td class="main" width="150"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
<td class="main"><?php echo tep_draw_input_field('email_address') . ' ' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></td>
</tr>
Please indicate the usefulness of this and/or if using it by adding your "thumbs up".PHP Code:<tr>
<td class="main" width="150"><?php echo ENTRY_EMAIL_CONFIRMATION; ?></td>
<td class="main"><?php echo tep_draw_input_field('email_confirmation') . ' ' . (tep_not_null(ENTRY_EMAIL_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_EMAIL_CONFIRMATION_TEXT . '</span>': ''); ?></td>
</tr>
EJ





1Likes
LinkBack URL
About LinkBacks







Reply With Quote

Bookmarks