We need get global cookie variable: global $cookie;

To check if user is logged in:

  • refer to the cookie ”isLogged()”method

global $cookie;

if(!$cookie->isLogged())
{
 echo 'Please login';
}
else
{
 echo 'Everything good';
}

Get user’s id:

  • $cookie->id_customer

Get user’s first name:

  • $cookie->customer_firstname

Get user’s surname:

  • $cookie->customer_lastname

Get user’s email address:

  • $cookie->email

Get a language id:

  • $cookie->id_lang

Full sample:


global $cookie;

if(!$cookie->isLogged())
{
 echo 'Please login';
 exit;
}
else
{
 echo 'Hi, ' . $cookie->customer_firstname. ' ' .$cookie->customer_lastname . '<br/>';
 echo 'We contact to you: '. $cookie->email;
}