Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

$customer_id and application_top.php


jhdesign

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...