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

You are not logged in.

Announcement

#1 2014-05-27 17:32:03

Leo Yarto
Member
Registered: 2014-05-23
Posts: 5

More on actions after closing Chat

Hi  Remi ,I want to dig deeper into the actions after closing chats , for instance I want to redirect the user to another page , for example to fill a survey ,right after the operator closes the chat. Are you aware of which instance to invoke to accomplish this?Greetings .


https://groups.google.com/forum/#!topic … fyTkfFUGKE

Offline

#2 2014-05-27 20:35:19

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

Re: More on actions after closing Chat

Hi,

Good question. In general two options there.
1. Is you customer closing page widget?
2. Is your customer is closing popup?

These two requires completely different approaches.
So which one is your case?


Offline

#3 2014-05-27 20:52:26

Leo Yarto
Member
Registered: 2014-05-23
Posts: 5

Re: More on actions after closing Chat

Well , im thinking that the operator closes a customer chat (in my scenario the customer can not reopen chat.), after that I want to redirect the customer to a survey. More likely the customer contacted the chat through the embedded widget.
Also , Its worth mentioning .. Im having a hard time calling the customstatus extension after enabling it on the settings.. Im calling an API on the close_chat  to see if im reaching that extension .. and well no .. the code is not reaching there.

Offline

#4 2014-05-27 21:30:18

Leo Yarto
Member
Registered: 2014-05-23
Posts: 5

Re: More on actions after closing Chat

Sorry Remi ,
Never mind the second part . The API didnt work because of network issues on my server .

Offline

#5 2014-05-27 21:44:00

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

Re: More on actions after closing Chat

Hi,

I ques if widget will be embeded in page. The easiest way
a. is just override this template https://github.com/LiveHelperChat/livehelperchat/blob/master/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php

b. Or just have custom JS in site itself which attaches event to https://github.com/LiveHelperChat/livehelperchat/blob/master/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php#L366 to element with id lhc_close

c. In atacched function you can just directly redirect user to some page, or you can also try to use http://livehelperchat.com/chats-export-module-tutorial-177a.html to get chat status before redirecting user. Or just write your own module smile





Offline

#6 2014-05-29 16:40:29

Leonardo Yarto
Member
Registered: 2014-05-29
Posts: 2

Re: More on actions after closing Chat

So this is what I did to redirect a customer to a surver when operator closes chat. I located the file lh.js
Added an else condition to if (data.blocked != 'true')
var evaluate= confirm("Would you like to evaluate the operator?");                  if (evalua==true){                      $('#status-chat').html(data.status);                   $('#ChatMessageContainer').remove();                   $('#ChatSendButtonContainer').remove();                    top.window.location = 'http://mywbsitesurvey?idChat=' + this.hash;                  }else{                                    $('#status-chat').html(data.status);                   $('#ChatMessageContainer').remove();                   $('#ChatSendButtonContainer').remove();}

Overriding this template  https://github.com/LiveHelperChat/livehelperchat/blob/master/lhc_web/design/defaulttheme/tpl/lhchat/getstatus.tpl.php is usefull when customer closes chat from widget.



Hope this is usefull and thanks for your help.

Offline

#7 2015-02-18 17:56:44

sledov
Member
Registered: 2014-11-04
Posts: 10

Re: More on actions after closing Chat

I am trying to catch the event when user closes the widget chat so I can display a text.
In the ......./design/defaulttheme/tpl/lhchat/getstatus.tpl.php i found:

document.getElementById('lhc_close').onclick = function() { lhc_obj.hide(); return false; };

-and-

} else if (action == 'lhc_close') {
            lh_inst.hide();
        }

modifying both makes no difference to the chat window. Even if I remove those lines, the close button still works.

Help?

Offline

#8 2015-02-18 18:31:23

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

Re: More on actions after closing Chat

Most likely you did not clear a cache. Please create a new topic next time.

https://livehelperchat.com/article/view/58
https://livehelperchat.com/how-to-use-d … -291a.html

Offline

Board footer