Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

where is customer_id set?


jg1119

Recommended Posts

Posted

Hello, I am trying to integrate the login for my store with the main login for the site - so customer does not have to login twice. Problem is I can (for the life of me :-) ) find where the heck customer_id is set in application_top.php I have looked for about 2 hours now and am willing to accept the dunce cap. Can anyone tell me where it is set? I am sending the customer_id over in a cookie from the main site (since oscommerce lives on the https side of the site and the rest is on http) so I can get it and set the variable in oscommerce.

 

I set the variables like this:

 

if (!tep_session_is_registered('customer_id'))

{//this is the new stuff

if (isset($_COOKIE['customer_id']) )

{

tep_session_recreate();

$customer_id = $_COOKIE['customer_id'];

$customer_default_address_id = $_COOKIE['customer_default_address_id'];

$customer_first_name = $_COOKIE['customer_first_name'];

$customer_country_id = $_COOKIE['customer_country_id'];

$customer_zone_id = $_COOKIE['customer_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');

}

else

{//end new stuff

$navigation->set_snapshot();

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

}//new

}

 

 

I also tried adding:

 

$_SESSION['customer_id'] = $customer_id;

$_SESSION['customer_default_address_id'] = $customer_default_address_id;

$_SESSION['customer_first_name'] = $customer_first_name;

$_SESSION['customer_country_id'] = $customer_id;

$_SESSION['customer_zone_id'] = $customer_zone_id;

 

but while I the data is being passed successfully and login is being bypassed, whenever I try to pull up data on other pages (account_edit.php) the customer_id is empty. Where is this variable set?

Posted

The customer_id is set in login.php in the block of code below (along with the other info)

It is then stored in the session.

 

$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');

Archived

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

×
×
  • Create New...