Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Check for email already exist in database? Where?


nnikolaj

Recommended Posts

Hello everyone

 

I have feeling, that OS commerce should check for email duplicates in the database, when a new customer creat an account and return an error message to him about that the email is already taken or something like that.

 

In my case this doesn't happen.

 

If a customer has signed up with an already existing email, he just forwards to the congratiolations-page, but is not beeing added in the database.

 

Also, when a customer add a new address to his account, so that he has 2 addresses, the email check does not happen.

 

I have searched the net for an answer, but could not fint the answer.

 

I have implemented serval contributions, which i suspect has done this. I am suspecting the contribution for "Prices for logged in users ONLY" and "Member Approval" to be the reason, but i do not know how to correct, or where to look to solve this problem.

 

With the member approval, the customer who used an already existing email address, is not showing up at the "waiting for approval" panel in admin area.

 

The contributions can be found here:::

 

Prices for logged in users ONLY!

http://www.oscommerce.com/community/contri...logged+in+users

 

Member Approval 1.5

http://www.oscommerce.com/community/contri...member+approval

 

Someone know how to correct this?

 

Best regards

Nikolaj

Link to comment
Share on other sites

OK.

 

I found out, that it has something to do with the Member Approval contribution.

 

I've installed a new shop and checked if the "email exist" worked.

 

...It did.

 

Then i installed the contribution for member approval, and checked if the "email exist" still worked.

 

... It did NOT!

 

Can someone please help me finding that error, causing this problem?

 

Here is the install instructions:

 

##################################################################

Installation
------------

#### [ OPEN ] ##################################################################

catalog/create_account.php 

##################################################################

## Find ################################

tep_session_register('customer_id');
tep_session_register('customer_first_name');
tep_session_register('customer_default_address_id');
tep_session_register('customer_country_id');
tep_session_register('customer_zone_id');

// restore cart contents
$cart->restore_contents();

and delete the whole lot.


## Find this [approx line 233]:  ################################

  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }

  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
  tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

  tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));


## Replace with this:  ################################

} else {
  $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
}
 }
// customer email notification 
$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// admin email notification 

$admin_email_text .= ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, nl2br($admin_email_text), $name, $email_address, '');

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
 }




#### [ OPEN ] ##################################################################

catalog/includes/languages/english/create_account.php 

##################################################################								   
## Add/Replace  ################################


## find this ##########################

define('EMAIL_TEXT', 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");

## replace with ######################

define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "\n\n");

define('EMAIL_TEXT', 'Your application to become a wholesale customer [which will enable you purchase our products at a discounted rate] is currently being evaluated.  We will notify you within 48 hours as to when you can access our eCommerce  system.  <br><br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");

define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "\n\n");


#### [ OPEN ] ##################################################################

catalog/login.php 

##################################################################

## Find this: [line 28] ################################

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

## Replace with this:  ################################

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id, member_level  from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");




## and after this [approx line 34]:  ################################

  if (!tep_validate_password($password, $check_customer['customers_password'])) {
	$error = true;
  } else {


## insert this: ################################


	if ($check_customer['member_level'] == 0 ) {
	  $HTTP_GET_VARS['login'] = 'invalid';
  $messageStack->add('login', TEXT_NOT_APPROVED);
	} else {



## Find this [approx line 67]:  ################################

	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}
  }
}
 }
 if ($error == true) {


## Replace with this:  ################################

	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	  }
	}
  }
}
 }
 if ($error == true) {





#### [ OPEN ] ##################################################################

catalog/includes/languages/english/login.php 

##################################################################								   
## Add/Replace  ################################

define('TEXT_VALID_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> This account has not been approved yet, please contact the site Administrator.');

define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'By creating an account at ' . STORE_NAME . ' you will be able to shop faster, be up to date on an orders status, and keep track of the orders you have previously made.  Please note that new accounts must first be approved to gain access to the catalog.');

define('TEXT_NOT_APPROVED', 'Your membership has not been approved yet');


#### [ OPEN ] ##################################################################

admin/filesnames.php

##################################################################

## Add ################################

 define('FILENAME_MEMBERS', 'members.php');


#### [ OPEN ] ##################################################################

admin/includes/application_top.php

##################################################################

## Add ################################

 define('FILENAME_MEMBERS', 'members.php');



#### [ OPEN ] ##################################################################

admin/includes/boxes/customers.php 

##################################################################

## After this: ################################

'<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .


## Insert this: ################################

'<a href="' . tep_href_link(FILENAME_MEMBERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_APPROVAL . '</a><br>' .

#####then add the following at the end just above   ?>#############################


define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);

define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n");

define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "\n\n");

define('EMAIL_TEXT_SUBJECT', 'Account Approved');

define('EMAIL_SEPARATOR', '----------------------------------------------');


Add or take out the "\n" 's to suit your taste in spacing




#### [ OPEN ] ##################################################################

admin/includes/languages/english.php 

##################################################################								   
## Add ################################

define('TABLE_HEADING_LASTNAME', 'Lastname');
define('TABLE_HEADING_FIRSTNAME', 'Firstname');
define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
define('TABLE_HEADING_ACTION', 'Action');
define('BOX_CUSTOMERS_APPROVAL', 'Waiting Approval');
define('HEADING_TITLE_SEARCH', 'Search');
define('HEADING_TITLE', 'Member approval');



##################################################################

 

Also included in the package:

 

catalog/admin/members.php

catalog/admin/includes/languages/english/images/button_activate.gif

 

-------------

 

Best regards.

Nikolaj

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...