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

You are not logged in.

Announcement

#1 2022-07-28 15:39:23

robdi123
New member
Registered: 2022-07-28
Posts: 2

prefill data on new widget

Hi, how can i prefill data on the new widget?

i try using the old method but it doesnt work.

on the old widget i use LHCChatOptions.attr_prefill.push({'name':'username','value':'<?= $user->username ?>'}); but on the new one i cant find the way to do the same thing.


Thanks.

Offline

#2 2022-07-28 16:43:12

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: prefill data on new widget

Hi, welcome on the Live Helper Chat Forum.
Please see if this article helps: https://doc.livehelperchat.com/docs/cus … -variables


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

#3 2022-07-28 18:14:54

robdi123
New member
Registered: 2022-07-28
Posts: 2

Re: prefill data on new widget

Hi, yes, i read that but i dont know how to use it on the new one.

on this one is easy:

<script type="text/javascript">
var LHCChatOptions = {};
LHCChatOptions.opt = {widget_height:340,widget_width:300,popup_height:520,popup_width:500};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
var referrer = (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 = '//10.69.76.49//soporte/index.php/chat/getstatus/(click)/internal/(position)/bottom_right/(ma)/br/(top)/350/(units)/pixels/(leaveamessage)/true?r='+referrer+'&l='+location;
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

but on this one

<script>var LHC_API = LHC_API||{};
LHC_API.args = {mode:'widget',lhc_base_url:'//10.69.76.49//soporte/index.php/',wheight:450,wwidth:350,pheight:520,pwidth:500,leaveamessage:true,check_messages:false};
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.setAttribute('crossorigin','anonymous'); po.async = true;
var date = new Date();po.src = '//10.69.76.49//soporte/design/defaulttheme/js/widgetv2/index.js?'+(""+date.getFullYear() + date.getMonth() + date.getDate());
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>

i dont understando how to do it.

i can pass the data as an aditional chat variable, but the data is not presented fine, because the list of online users show me the data the same way.

thanks

Offline

#4 2022-07-28 18:22:02

PeopleInside
Administrator
From: Italy
Registered: 2014-04-10
Posts: 4,046
Website

Re: prefill data on new widget

For that I cannot help, you would need try to wait here for a developer reply.
The developer can be more busy than me, if you still have no answer you can follow links on my signature and maybe try to ask on discord.


lol PeopleInside - Live helper chat - free limited forum support!
wink For commercial support or GitHub [see FAQ here]
ops If you want to support this open source project, just donate [see support page]
glasses Something wrong with the forum? [contact a superhero]

Offline

Board footer