Open Wix Chat with Buttons

Not the first to request this. I know many people have requested this.

Please create the ability for us to have site visitors to open Wix Chat by adding buttons throughout the website.

Currently you only get a default button that stays on all the pages. However, we would all like wix chat to be opened when a person clicks other buttons on the page or even text links.

Please add this ASAP.

5 Likes

Is this possible?

Currently opening the Wix Chat component with a button is not possible, but this is a great feature request.

Hi Lars,

You got it :slight_smile: Just use the new API of Chat + Corvid
https://www.wix.com/corvid/reference/$w.Chatbox.html#hide

Enjoy, Erez

how ? I choose the show/hide it only show the element but not automatically open the window and ready to chat.

export function myButton_click(event) {
$w(“#myChat”).maximize();
}

@larsdm11 , this is now possible by using the new wixChatAPIs. Let’s say you have a button on your site, and you add a onClick handler using the property panel of that button. Your code would look like this:


 export function buttonId1_click(event){ 
  
  $w("#chatBoxId").maximize(); 
  
 }
  

Hi guys, I am doing this for the very first time i am not familiar with programming at all. I receive an error all the time. Here is a screenshot

check the name of chatbox in properties.

I did check and this is the correct name. i am trying to make the button which is on the lightbox to open the chat.

where is the element “wixchat1”

you must close the light box then open the chat box

here


this is the property for the actual chat but i need a button “Chat Now” on the lightbox to open the actual chat

Hi, Did you manage to overcome what you wanted to do?

Hi @sal10 in order to close the light box and open the chat at the same button following is what you can do:
(Created Example page https://erezp02.wixsite.com/mysite-109 )

  1. On your main page don’t open the light box automatically but open it from your code (I don’t it onClick event but you can do it with setTimeout on the onReady):
import wixWindow from 'wix-window';

$w.onReady(function () {
    $w('#button1').onClick(() => {
        wixWindow.openLightbox("Welcome (Full Screen)",)
        .then( (data) => {
            if (data === "MaximizeChat") {
                $w('#wixChat1').maximize()
            }
        });
    });
});
  1. Then on your light box page add the following code and I bind it to the close button.
import wixWindow from 'wix-window';

$w.onReady(function () {
    $w('#button2').onClick(() => {
        wixWindow.lightbox.close("MaximizeChat");
    })
});

Enjoy, Erez

Dear @erez-paperny ,

Thank you very much for your codes. I REALLY APPRETIATE it. The only problem is that chat window does not automatically opens when you click on that button.

Hi @sal10 , In order to investigate more please share your site URL
(If you prefer private you can send to my email : erezp@wix.com)

hi there, i dont think it works well on mobile

@puvi247x Exactly right, it’s not works

I need this too.