Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

initialize $customer_id, where?


Guest

Recommended Posts

Posted

I'm having to make some modifications to the shopping_cart.php class, but I can't figure out where customer_id is intialized. Here's an sql insert that uses $customer id:

 

if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . $customer_id . "', '" . $products_id . "', '" . $qty . "', '" . date('Ymd') . "')");

 

thanks in advance.

Posted

[2.2-MS1]

 

When a customer logs in, it's initalized in catalog/login.php:

 

$customer_id = $check_customer['customers_id'];

 

(check_customer[] is the query result of looking up the customer in the database by his email address.)

 

After logging in, since it's registered as a session variable, it's set automagically by PHP. The session initialization is handled in includes/application_top.php.

Archived

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

×
×
  • Create New...