Hi, i am just looking for someone to show me what to write to make a button open the wixchat widget on a page on my site. I’ve posted some photos with the info needed.
Let me explain. I am just looking to get some interactivity on a button that then opens the wixchat app on my site.
So, steps:
User Clicks the ‘mail’ icon - #iconbutton1
Wix App widget will then open on the site, so the user can chat with us directly.
Here is your answer and you might consider changing the subject to your post to a more descriptive one.
Suggested subject
“Open Chat Widget when button is clicked”
Ok thanks Andreas, I guess not then, seems like a very simple thing to implement, but i’m glad im not spending hours trying to figure it out if it’s not available!
Hey, what seem like a simple API Call demands to much more I am afraid. The platform is so large that every little new feature and API Call needs to be tested and tried out and also valued if many users will appreciate the new feature. With more than 130,000,000 users small shit takes energy and time
Good luck coding Chris.
PS Don’t forget to watch the new videos for beginners on wixshow.com all free DS
@erez-paperny
I want a button that need to open the chat widget in window or expand where is it should be ready to chat. when I code .show it just only show the widget and my visitor need to click the widget to chat so it would be hassle for them that they click a button twice. I just want a button that open exactly the widget and ready to chat. is that possible? thanks for the help
@joshcarreondesigns
Check to make sure that you have put the onClick event handler function onto the button element itself through the properties panel for the button.
export function button1_click(event) {
$w('#wixChat1').maximize();
}
If you are still not getting it to work, then please try it with the console log and see what you get returned as shown in the Wix Chatbot API reference.
Maximize the chatbox and log a message when done
$w("#myChatbox").maximize()
.then(() => {
console.log("Done with maximize");
});
In the editor you will get error (Known issue that will be resolved in the coming days) But it should work on the live site. Try and le me know if you have an issue.
@erez-paperny
Just checked it myself to see what was happening and it seems that Joshua is correct and the Wix Chat app is not being allowed to have the function of maximize set to it.
I have tried with a simple button and first of all just tried with the same export function as Joshua has tried and it came up with the error. I then tried with the console log code and it was still not being recognized and therefore returning nothing in the console log.
However, if you change the function to show or hide as in the first pic below, or to collapse as in the second pic shown below, then the functions are allowed and it all works fine when you preview it.
So, it seems that the Wix Chat app is not recognising the minimize and maximize as of yet even though it is stated as a workable function in the Wix API reference.
My thinking is that as the Wix Chat app element is classed as an iframe on your page, therefore it will not recognise the minimize and maximize functions, whereas the iframe will allow the show/hide and expand/collapse functions (as shown in the iframe and HTML sections in the Wix API reference.
I am guessing that this is not intentional and that the Wix Chat app should see the minimize and maximize functions from the Wix Chatbot API, so it needs looking at and sorting out ASAP.
Whilst looking at this, can Wix also double check that the onMessageSent and the onMessageReceived functions work too and an event handler is run when a message is sent or received, as some users have stated in this forum that they can’t get this to work.
Okay, so ignore my reply above please as I’ve seen your reply above about it all working fine in the fully published site and it does as I published and tested it on the simple site that I used for testing.
It seems to be like when MenuContainer was released, that there were some quirks with it that still worked although they were showing up with the no function error.
So, we’ve learnt from this not to trust the preview if it says there is no function for it and always test it on a live site, just like other Wix API like Wix Users.
Hello everyone
Sorry to bother you again on the same matter
I cannot figure out why it still doesn’t work. I read every comment but still…
So I am trying to link a button in my website to the chat. I want that when a visitor clicks the button → the chat opens. I copied all of the different codes but still. What am I doing wrong ? Help !
Tom