Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions

You are not logged in.

Announcement

#1 2014-10-29 10:48:08

fridzema
Member
Registered: 2014-10-29
Posts: 4

Custom user name

Hello people,

At first my english is not perfect, i hope you guys understand what i am trying to say.

I am struggling a while to get a custom nickname in the chat.
At the moment is use this code as a temporary fix so we can see who is chatting:

              var LHCChatOptions = {};
              LHCChatOptions.attr = new Array();
              LHCChatOptions.attr.push({'name':'Taal','value':'Nederlands', 'type':'hidden'});
              LHCChatOptions.attr.push({'name':'User ID','value':'{{ $user->id }}', 'type':'hidden'});
              LHCChatOptions.attr.push({'name':'Username','value':'{{ $user->username }}', 'type':'hidden'});
              LHCChatOptions.attr.push({'nick':'nick','value':'{{ $user->username }}', 'type':'hidden'});
              LHCChatOptions.attr.push({'name':'E-mail','value':'{{ $user->email }}', 'type':'hidden', 'type':'hidden'});
              LHCChatOptions.attr.push({'name':'Geslacht','value':'{{ $user->sex }}', 'type':'hidden'});
              LHCChatOptions.attr.push({'name':'Voornaam','value':'{{ $user->name }}', 'type':'hidden'});
              LHCChatOptions.attr.push({'name':'Achternaam','value':'{{ $user->surname }}', 'type':'hidden'});
              LHCChatOptions.opt = {widget_height:340,widget_width:300,popup_height:263,popup_width:500};

              (function() {
              var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
              var refferer = (document.referrer) ? encodeURIComponent(document.referrer.substr(document.referrer.indexOf('://')+1)) : '';
              var location  = (document.location) ? encodeURIComponent(window.location.href.substring(window.location.protocol.length)) : '';
              po.src = '//www.domain.com/chat/index.php/nld/chat/getstatus/(position)/bottom_right/(nickname)/test/(ma)/br/(check_operator_messages)/true/(top)/350/(units)/pixels/(leaveamessage)/true/(department)/1/(operator)/3?r='+refferer+'&l='+location;
              var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
              })();

I can't find anywhere how to pass a nickname to the chat!

I hope one of you guys can help me out!
Thanks in advance!

Last edited by fridzema (2014-10-29 10:48:50)

Offline

#2 2014-10-29 11:06:15

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Custom user name

Read this article.
https://livehelperchat.com/pre-filling- … -140a.html

To prefill existing attributes you should use

LHCChatOptions.attr_prefill = new Array();
LHCChatOptions.attr_prefill.push({'name':'email','value':'***.com','hidden':true});
LHCChatOptions.attr_prefill.push({'name':'phone','value':'370454654'});
LHCChatOptions.attr_prefill.push({'name':'username','value':'Username here'});

Offline

#3 2014-10-29 11:23:20

fridzema
Member
Registered: 2014-10-29
Posts: 4

Re: Custom user name

Thanks for your fast reply!

But that is not what i mean, i want to modify the actual chat nickname.

Now if somebody sends a message it is like this:

Visitor: Test message

I really want to change Visitor and i cant find a solution for that.

I hope you can understand/help me!

Offline

#4 2014-10-29 11:26:07

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,661
Website

Re: Custom user name

Try this
1. Once you add this javascript this field will be prefilled.
2. To make it hidden edit form start settings and just hide this field from filling from user side. Tick "This field is invisible but prefilled data is collected"

If won't work, you are on your own smile

Offline

#5 2014-10-29 12:24:47

fridzema
Member
Registered: 2014-10-29
Posts: 4

Re: Custom user name

Thanks man finally it works !

Offline

Board footer