Hide live chat link when offline

I would like to install LiveHelpNow as a link which will hide when all operators are offline.

Here are steps by step instructions:

 

  1. This step is only required if LiveHelpNow chat or helpOut button code is not already installed on your web page: Install invisible button code anywhere on your web page. Invisible button code may be found in Admin Panel->Chat system->installation->Live chat button->For websites.
  2. Add the HTML code to your web page for the link similar to this: <a id="lhnLiveChatLink" href="#" onclick="OpenLHNChat();return false;">Live chat</a>
  3. Add this JavaScript code to the page:

    <script type="text/javascript">
    
    function LHN_button_onLoad() {
    if (bLHNOnline == 0) {
    //All operators are offline
    document.getElementById('lhnLiveChatLink').style.display='none';
    }
    else {
    //There are operators online
    document.getElementById('lhnLiveChatLink').style.display='block';
    }
    }
    </script>
  4. Done

Related articles