jhdesign Posted November 24, 2006 Posted November 24, 2006 I'm trying to execute this query in application_top.php $customersid_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = " . (int)$customer_id . ""); $customersid = tep_db_fetch_array($customersid_query); echo 'ID is ' . $customersid['customers_group_id']; if ($customersid['customers_group_id'] > 0) { require(DIR_WS_CLASSES . 'shopping_cart.php'); } else { require(DIR_WS_CLASSES . 'shopping_cart_org.php'); } But its always false because $customer_id has not been intiated yet, how can I fix this? When is customer_id first obtained?
boxtel Posted November 24, 2006 Posted November 24, 2006 I'm trying to execute this query in application_top.php $customersid_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = " . (int)$customer_id . ""); $customersid = tep_db_fetch_array($customersid_query); echo 'ID is ' . $customersid['customers_group_id']; if ($customersid['customers_group_id'] > 0) { require(DIR_WS_CLASSES . 'shopping_cart.php'); } else { require(DIR_WS_CLASSES . 'shopping_cart_org.php'); } But its always false because $customer_id has not been intiated yet, how can I fix this? When is customer_id first obtained? after someone has signed in. Treasurer MFC
jhdesign Posted November 25, 2006 Author Posted November 25, 2006 after someone has signed in. I am signed in, my question was which point of the file execution does the customer id get obtained. Any ideas why the top code doesnt work?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.