Could you please help me out on how to show and hide the web chat button dynamically based on the page navigation or with some value?

I gave a condition to chat button in below format but doesn't work
webchat: {
chatButton: {
enabled: isValueExists ? true : false,
'template': '<div class="cx-widget cx-webchat-chat-button cx-side-button" id="geneChatButton" onclick="myChatButton()" role="button" tabindex="0" data-message="ChatButton" data-gcb-service-node="true"><span class="cx-icon" data-icon="chat"></span><span class="i18n cx-chat-button-label" data-message="ChatButton"></span></div>',
openDelay: 3000,
effectDuration: 300,
hideDuringInvite: true
},
}
You can set enabled to false and then control the visibility using commands: WebChat - Genesys Documentation
himaja
3
I am failing to enable the chat button using commands and setting enable to false... please guide me on how to handle this..
window._genesys = {
widgets: {
main: {
debug: false,
theme: "light",
lang: "en",
customStylesheetID: "genesys_widgets_custom",
preload: ['webchat'],
// OR define the JSON object inline
i18n: {
"en": {
"webchat": {
"ChatTitle": "Chat with us",
}
}
}
},
webchat: {
userData: {},
emojis: true,
cometD: {
enabled: false
},
autoInvite: {
enabled: false,
timeToInviteSeconds: 5,
inviteTimeoutSeconds: 30
},
chatButton: {
enabled: false,
'template': '<div class="cx-widget cx-webchat-chat-button cx-side-button" id="geneChatButton" onclick="myChatButton()" role="button" tabindex="0" data-message="ChatButton" data-gcb-service-node="true"><span class="cx-icon" data-icon="chat"></span><span class="i18n cx-chat-button-label" data-message="ChatButton"></span></div>',
openDelay: 2500,
effectDuration: 300,
hideDuringInvite: true
},
form: {
wrapper: "<table></table>",
},
uploadsEnabled: true,
enableCustomHeader: true,
transport: {
dataURL: "",
type: "",
endpoint: "",
headers: {
"x-api-key": ""
},
stream: "qa"
}
},
onReady: function(){
var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
oMyPlugin.command('WebChat.showChatButton', {
openDelay:1000,
duration: 1000
}).done(function(e){
window._genesys.widgets.webchat.chatButton.enabled = true;
}).fail(function(e){
});
}
}
};
system
Closed
4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.