Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter qstudio

    (@qlstudio)

    Ok – we dug in the plugin code to find the JS trigger:

    document.querySelector(‘call-us’).shadowRoot.getElementById(‘wplc-chat-button’).click();

    Just some guidance on the UI styling would be good – thanks!

    Did you solved the trigger?Trying to figure out the same right now.Any help will be appreciated.

    Plugin Support wpdev3cx

    (@wpdev3cx)

    Hi,
    there is a Gutenberg block for this functionality. You can handle the settings through the “Live Chat > Settings > Gutenberg Blocks” section and then use “WP Live Chat Trigger” block in any page you need.

    In my case it’s not possible cause i need a global button in every woocommerce product page and with the old trigger system it worked perfectly.

    Thread Starter qstudio

    (@qlstudio)

    @throu – just bind an event to an element, using jQuery and pass the event through, like so – untested pseudo-code, but you can get it working as you need it:

    
    jQuery( '#elementID' ).click( function(e) {
        document.querySelector(‘call-us’).shadowRoot.getElementById(‘wplc-chat-button’).click();
    });
    Thread Starter qstudio

    (@qlstudio)

    Better example:

    // open chat from external trigger ##
    jQuery(document).on( 'click', '.open-chat', function(){
    
        console.log( 'Clicked open chat' );
        document.querySelector('call-us').shadowRoot.getElementById('wplc-chat-button').click();
    
    });

    @qlstudio thanks for your help!I’ll check everything today.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Open Chat from external Trigger’ is closed to new replies.