Viewing 6 replies - 1 through 6 (of 6 total)
  • I have the same question. Is there any possiblity at being able to toggle whether only logged in or logged out users are able to view the chat widget? Didn’t see anything in the API regarding that.

    Hi IvanSlater and michent1,

    currently the widget shows to all, i will let the Product Owner know of this request to show the widget only for logged in users as an option.

    Regards,
    Team Zopim

    You can add this to Zopim widget options:

    var logged = jQuery('body').hasClass('logged-in');
    if (!logged){$zopim.livechat.hideAll()}

    Jquery is required (Note that i’m using jQuery instead of $) and it must go inside Zopim function.

    $zopim( function() {
    // Here goes the code
    })

    Thanks sebash. still runnin into some issues getting it to work. Probably just my lack of understanding the proper syntax. Here’s my code:

    $zopim( function() {
    var logged = jQuery('body').hasClass('logged-in');
    if (!logged){$zopim.livechat.hideAll()}
    <!--Start of Zopim Live Chat Script-->
    <script type="text/javascript">
    window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
    d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
    _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");
    $.src="//v2.zopim.com/?370MNN03WMvxioWoTJonsZSExSOrbTVl";z.t=+new Date;$.
    type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");
    </script>
    <!--End of Zopim Live Chat Script-->
    })

    Have you tried without the zopim’s script? That script is added autamatically by the plugin, so you can just leave the code like this

    $zopim( function() {
    var logged = jQuery('body').hasClass('logged-in');
    if (!logged){$zopim.livechat.hideAll()}
    })

    Tell me if it works, i’ll be aware!

    This works but I’m using the plugin https://wordpress.org/plugins/ultimate-member/ and my users can’t see the Zopim chat widget, only the admins can see it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Only for logged in users’ is closed to new replies.