Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

to have more than one account per email


frank1002us

Recommended Posts

hi

i want to allow more than one account per email address "guest accounts"

i have made the changes to make this possible to have more than one account per email address now i want the customer to be able to login if he decided to make an account.

now when he try to login a search is made for the email address and when email is found it compares the password and if it does not match it just display error message

// Check if email exists
? ?$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) . "'");
? ?if (!tep_db_num_rows($check_customer_query)) {
? ? ?$HTTP_GET_VARS['login'] = 'fail';
? ?} else {
? ? ?$check_customer = tep_db_fetch_array($check_customer_query);
// Check that password is good
? ? ?if (!tep_validate_password($password, $check_customer['customers_password'])) {
? ? ? ?$HTTP_GET_VARS['login'] = 'fail';
? ? ?} else {
? ? ? ?$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $check_customer['customers_id'] . "' and address_book_id = '1'");
? ? ? ?$check_country = tep_db_fetch_array($check_country_query);

? ? ? ?$customer_id = $check_customer['customers_id'];
? ? ? ?$customer_default_address_id = $check_customer['customers_default_address_id'];
? ? ? ?$customer_first_name = $check_customer['customers_firstname'];
? ? ? ?$customer_country_id = $check_country['entry_country_id'];
? ? ? ?$customer_zone_id = $check_country['entry_zone_id'];
? ? ? ?tep_session_register('customer_id');
? ? ? ?tep_session_register('customer_default_address_id');
? ? ? ?tep_session_register('customer_first_name');
? ? ? ?tep_session_register('customer_country_id');
? ? ? ?tep_session_register('customer_zone_id');

? ? ? ?$date_now = date('Ymd');
? ? ? ?tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . $customer_id . "'");

i want to modify this code to have a loop so if the match is not made the search to continue untill either a match is found or there is no more customer in the table.

this will allow a customer to create an account on his second visit.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...