Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

$customer_id and application_top.php


jhdesign

Recommended Posts

Posted

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?

Posted
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

Posted
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?

Archived

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

×
×
  • Create New...