Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Pages: 1
Hi!
Please help with my question:
I added column "onlyname" (variable name - lhc.onlyname) and variable "onlyname" (JavaScript variable value - window.lhc_var.attr_str_1, Variable identifier - lhc.onlyname). Then I chatted with bot for a while.
After that when I look at dashboard column "onlyname" is empty. What am I doing wrong?
<script>
if (typeof lhc_var === 'undefined'){
window.lhc_var = {}; // Window is required to define variable in global scope
};
lhc_var.nick = 'my full name';
lhc_var.email = ***.com';
lhc_var.pin = '';
lhc_var.phone = '';
lhc_var.loginad = 'ad';
lhc_var.usernamepassing = 'ad';
lhc_var.attr_str_1 = 'my first name and middle name';
var LHC_API = LHC_API||{};
LHC_API.args = {mode:'widget',lhc_base_url:'//172.30.105.100/index.php/',wheight:450,wwidth:350,pheight:520,pwidth:500,leaveamessage:true,theme:1,check_messages:false,lang:'rus/'};
(function() {
var po = document.createElement('script');
po.type = 'text/javascript';
po.setAttribute('crossorigin','anonymous');
po.async = true;
var date = new Date();
po.src = '//172.30.105.100/design/defaulttheme/js/widgetv2/index.js?'+(""+date.getFullYear() + date.getMonth() + date.getDate());
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
})();
</script>
Last edited by Snake19 (2020-10-23 10:53:56)
Offline
Please read documentation how properly define define additional chat variables. It's addifional variable you are passing so lhc.onlyname is invalid.
Offline
I have added few more samples to be more explicit. Should clarify everything now.
https://doc.livehelperchat.com/docs/cus … -variables
Offline
Thank you a lot, remdex! Now with "additional_data.myVariable" I can pass my variables.
Offline
I've got simmilar question - how can I pass additional variables in bot messages. E.g. I want to bot to greeting me with my name (not full name) - "Hi, {additional_data.only Name}, welcome you!"
How can I do that?
Offline
Offline
Thanks! I got it via {lhc.add.myfield}.
Offline
Hello
I am trying to show the wordpress logged-in user name in custom variable.
I tried a lot of configuration with no success.
I really do not know what am I doing wrong. Can somebody help me?
CUSTOM CHAT VARIABLE
CUSTOM CHAT COLUMN
if (typeof additional_data === 'undefined') { // This variable has to be defined before Live Helper Chat embed script.
window.additional_data = {}; // Window is required to define variable in global scope
};
// additional_data.wpname= 'testname1';
var LHC_API = LHC_API||{};
// tried dirrect passing. (also)
LHC_API.args = {additional_data:{wpname: 'testname2'}, mode:'widget',lhc_base_url:'//collantlover.it/chat/index.php/',wheight:450,wwidth:350,pheight:520,pwidth:500,leaveamessage:true,check_messages:false,lang:'ita/'};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.setAttribute('crossorigin','anonymous'); po.async = true;
var date = new Date();po.src = '//collantlover.it/chat/design/defaulttheme/js/widgetv2/index.js?'+(""+date.getFullYear() + date.getMonth() + date.getDate());
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
I owe you one!
Last edited by delbono72 (2021-08-25 18:11:43)
Offline
Hi delbono72, thank you for your message!
Remdex the developer can be busy.
You may try to wait to see if a reply will be possibile here.
You may also want visit the official website https://livehelperchat.com/ where you can find:
Documentation: https://livehelperchat.com/documentation-6c.html
Support and License info: https://livehelperchat.com/support-13c.html
Discord chat channel: https://discord.com/invite/YsZXQVh
PeopleInside - Live helper chat - free limited forum support!
For commercial support or GitHub [see FAQ here]
If you want to support this open source project, just donate [see support page]
Something wrong with the forum? [contact a superhero]
Offline
Still here trying with no luck..
I tried all possible alternatives / interpretations of documentation with no success.
(not all together like in the code here below of course)
I added also Additional variable like the example in this page. and like the placeholder suggests
javascript variable name: window.lhc_var.usernamepassing
variable name: nick
variable identifier: lhc.nick
The Nickname in columns appear just as "Visitor" in chat or "V1234" in online users list, whatever I do.
if (typeof lhc_var === 'undefined') { // This variable has to be defined before Live Helper Chat embed script.
window.lhc_var = {}; // Window is required to define variable in global scope
};
lhc_var.usernamepassing = 'myCustomNickname';
lhc_var.nick = 'myCustomNickname';
lhc_var.gender = 'myCustomNickname';
var LHC_API = LHC_API||{};
LHC_API.args = {lhc_var:{nick:'myCustomNickname'},mode:'widget',lhc_base_url:'//collantlover.it/chat/index.php/',wheight:450,wwidth:350,pheight:520,pwidth:500,leaveamessage:true,check_messages:false,lang:'ita/'};
lhc_var.usernamepassing = 'myCustomNickname';
lhc_var.nick = 'myCustomNickname';
lhc_var.gender = 'myCustomNickname';
(function() {
lhc_var.usernamepassing = 'myCustomNickname';
lhc_var.nick = 'myCustomNickname';
lhc_var.gender = 'myCustomNickname';
var po = document.createElement('script'); po.type = 'text/javascript'; po.setAttribute('crossorigin','anonymous'); po.async = true;
var date = new Date();po.src = '//collantlover.it/chat/design/defaulttheme/js/widgetv2/index.js?'+(""+date.getFullYear() + date.getMonth() + date.getDate());
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
If I run the following console commands
> lhc_var.nick returns
> LHC_API.args.lhc_var.nick
I GET "myCustomNickname" both times byt in online visitors list or chat list I always get "Visitor"
I tried also passing lhc_var.gender but nothing changed
I do not know what to do anymore.
I'll give up.
Last edited by delbono72 (2022-11-03 18:07:02)
Offline
Pages: 1