Redirect to custom offline window when all operators are offline
I would like to redirect the visitor to a custom offline contact form which already exists on my site instead of opening LiveHelpNow "leave a message" form, is this possible?
To direct customers to a custom page on your website when all agents are offline we recommend first configuring embedded widget to hide chat tab when all agents are offline.
You may do so in Admin Panel > System setup > Website code, open embedded widget settings and change Offline button state to Hidden.
You will then need to add a hidden link, button, image, etc. on your website to be linked to the custom page you want visitors to go when all agents are offline and show it only when all agents are offline by adding the following code to your page.
<script>
function lhnStatusUpdate(){
if(lhnJsSdk.isOnline == false){
lhnQuery('#yourbuttonID').show();
}
}
</script>
For classic pop up style window, please use this:
Please change LHNACCOUNTID with NUMERIC portion of your LiveHelpNow account # and YOUR OFFLINE FORM URL with URL on your site to redirect the visitor to.
<SCRIPT>
function CustomOpenLHNChat(){
if (typeof lhnWin !== 'undefined' && lhnWin){
if (!lhnWin.closed){
lhnWin.blur();
setTimeout(lhnWin.focus(), 10);
return false;
}
}
var wleft = (screen.width - 580-32) / 2;
var wtop = (screen.height - 420 - 96) / 2;
if (bLHNOnline == 0) { location.href='YOUR OFFLINE FORM URL';} else {
lhnWin=window.open('https://www.livehelpnow.net/lhn/livechatvisitor.aspx?lhnid=LHNACCOUNTID', 'lhnchat', 'left=' + wleft + ',top=' + wtop +',width=580,height=435,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes');
}
}
</SCRIPT>
*IMPORTANT FOR DEPT ROUTING VIA CHAT BUTTON
If your are using dept routing via the chat button, please use the code below instead of the code above. Please change LHNACCOUNTID with NUMERIC portion of your LiveHelpNow account # and DEPTNUMBER with the dept number you want to use.
Place YOUR OFFLINE FORM URL with URL on your site to redirect the visitor to.
<SCRIPT>
function CustomOpenLHNChat(){
if (typeof lhnWin !== 'undefined' && lhnWin){
if (!lhnWin.closed){
lhnWin.blur();
setTimeout(lhnWin.focus(), 10);
return false;
}
}
var wleft = (screen.width - 580-32) / 2;
var wtop = (screen.height - 420 - 96) / 2;
if (bLHNOnline == 0) { location.href='YOUR OFFLINE FORM URL';} else {
window.open('https://www.livehelpnow.net/lhn/livechatvisitor.aspx?lhnid=LHNACCOUNTID&d=DEPTNUMBER', 'lhnchat', 'left=' + wleft + ',top=' + wtop +',width=580,height=435,toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,copyhistory=no,resizable=yes');
}
}
</SCRIPT>