Back to PhocacartUser class

Method getUserInfo

public static
getUserInfo
()

Method getUserInfo - Source code

public static function getUserInfo()
{
    $u = array();
    $user = PhocacartUser::getUser();
    $u['username'] = '';
    $u['id'] = 0;
    $u['ip'] = '';
    if (isset($user->id)) {
        $u['id'] = $user->id;
    }
    if (isset($user->username)) {
        $u['username'] = $user->username;
    }
    $u['ip'] = PhocacartUtils::getIp();
    return $u;
}