osCmax v2.5 User Manual
Results 1 to 1 of 1
Like Tree1Likes
  • 1 Post By ridexbuilder

Hack: Email Confirmation

This is a discussion on Hack: Email Confirmation within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; As standard, a customer can enter their email address incorrectly (speeling mistoke) during the 'create account' process. This way they ...

      
  1. #1
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    1 out of 1 members found this post helpful.

    Lightbulb Hack: Email Confirmation

    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 ?>
    Code:
    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.');
    2. catalog/create_account.php
    Look for
    PHP Code:
        $email_address tep_db_prepare_input($HTTP_POST_VARS['email_address']); 
    Replace with/add
    PHP Code:
        $email_address tep_db_prepare_input($HTTP_POST_VARS['email_address']);
        
    $email_confirmation tep_db_prepare_input($HTTP_POST_VARS['email_confirmation']); 
    3. Also, in catalog/create_account.php
    Look for
    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
    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;

               
    $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);
        }
        } 
    (Note that last } will already exist.)

    4. catalog/templates/your-template/content/create_account.tpl.php (copy with one from fallback, if needs be.)
    Look for:
    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') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? '<span class="inputRequirement">' ENTRY_EMAIL_ADDRESS_TEXT '</span>'''); ?></td>
                  </tr>
    Directly below it add:
    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') . '&nbsp;' . (tep_not_null(ENTRY_EMAIL_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' ENTRY_EMAIL_CONFIRMATION_TEXT '</span>'''); ?></td>
                  </tr>
    Please indicate the usefulness of this and/or if using it by adding your "thumbs up".

    EJ
    Last edited by ridexbuilder; 07-08-2011 at 05:13 AM. Reason: typo
    wkdwich likes this.
    Hosting plans with installation, configuration, contributions, support and maintenance.

Similar Threads

  1. Order confirmation email
    By tcshadow in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 09-16-2010, 06:07 PM
  2. Additional confirmation email
    By altenter in forum osCmax v2 Customization/Mods
    Replies: 13
    Last Post: 09-05-2010, 01:08 PM
  3. Logo in Email Confirmation
    By creativeone in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 10-03-2007, 11:09 AM
  4. email confirmation order
    By valandre64 in forum osCmax v2 Installation issues
    Replies: 2
    Last Post: 07-23-2006, 09:51 PM
  5. Order confirmation email?
    By peter in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 09-19-2003, 04:50 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •