Tags
PHP
Asked 3 years ago
18 May 2021
Views 378
steave ray

steave ray posted

how to get user id at OSCommerce

i am making some custom code for OSCommerce
i want to get the current logged in user or not and if yes need to print user id and other detail
jqueryLearner

jqueryLearner
answered Nov 30 '-1 00:00

customer_id is registered after login at OSCommerce
you can check or get user id like this and can use as want

 if (!tep_session_is_registered('customer_id')){
             $userid ='';
            } else{
              $userid = $customer_id ;
            }
echo $userid;

function tep_session_is_registered is used for checking is the customer_id in the session or not if not than user is not yet logged in.
tep_session_is_registered return true(if user logged in) or false(if user not loggged in )
$customer_id contain the current logged in user id.
Post Answer