How to add the Zendesk or Zopim chat with the FAQPrime widget?

   

Answer

Step 1: Add your Zendesk/Zopim code below the Widget code in the HTML Page.

<!--Start of Zendesk Chat Script-->

<Your Zendesk Code

<!--End of Zendesk Chat Script-->

Step 2: In the faqbotChatExecution function add the following line -

  function faqbotChatExecution()
    {
     if (typeof $zopim !== 'undefined') {
       $zopim.livechat.window.show();
     }
     else {
       setTimeout(function(){$zopim.livechat.window.show();}, 5000);
     }

    }

Step 3: Goto your zendesk setting and modify the widget behavior i.e. "Hides widget".

setting > widget > setting > Hide Widget

 

Workaround for the step 3: Add the following code after the bot code 

<script>

      // Set the Zopim/Zendesk to Hide
       var faqbotMyVar = setInterval(faqbotMyTimer, 200);
       function faqbotMyTimer() {
               if (typeof $zopim !== 'undefined') {
                       $zopim.livechat.hideAll();
                       $zopim.livechat.window.onHide(faqbotZopimClose);
                       clearInterval(faqbotMyVar);
               }
       }
       function faqbotZopimClose()
       {
               $zopim.livechat.hideAll();
       }

</script>

...