Live Helper Chat support forum.. Old google groups forum can be found here

You are not logged in.

Announcement

#1 2021-06-14 13:23:04

Grom
New member
Registered: 2021-06-09
Posts: 6

Set Condition based on language for Bot

Hello,

I just learning LHC so no judgment too much please smile

I wonder if is posible to set conditions in Bot based on language to shown specific buttons according for each language.

I have thre languages and text I can translate ok via translation.

I would like aso create link buttons which point to each languages and have diferent names acording for each language.

Something like this:

Condition check lang = eng
- show Button 1

Condition check lang = ita
- show Button 2

Condition check lang = slo
- show Button 3


So to be more clear, I would like to send Button list and send list, depending on language is this possible, is there any workaround to do it?



Thank you, and good day too you all.

Last edited by Grom (2021-06-15 08:32:23)

Offline

#2 2021-06-16 06:43:50

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,507
Website

Re: Set Condition based on language for Bot

Hi,

If bot's are so different it makes sense just to have different bot per language. E.g you can create for different langauge different department and then different bot for each of it. If you do not want to change and just have different https://doc.livehelperchat.com/docs/bot … onditions/

`siteaccess` attribute you can use or you can use just chat locale attribute.

https://doc.livehelperchat.com/docs/bot … aceholders

This change I just pushed so make sure you update.

Offline

#3 2021-06-16 15:46:45

Grom
New member
Registered: 2021-06-09
Posts: 6

Re: Set Condition based on language for Bot

Hi thank you for ansfer
I just pass variable for language via embed code and use condition triger before buttons to check these variable. work like a charm.

Now I have diferent trouble, for GDPR I put in my embed code folowing:
var LHC_API = LHC_API||{};
LHC_API.args = {cookie_enabled: (false),......

when I manuali paste in console: window.$_LHC.eventListener.emitEvent('enableCookies'); Work as is should.

But there is no way, i spend last 4 hours to somehow use these code when someone press my agree with cookies button

I try use simple exsecution,
window.$_LHC.eventListener.emitEvent('enableCookies');
then
console.log(window.$_LHC.eventListener.emitEvent('enableCookies');
and all posible vairant these code. then I tr try use external js. sheet

Is it just missinon imposible at these point. 4 hours for execute this code yikes
Always I get error
Uncaught TypeError: Cannot read property 'eventListener' of undefined
    at cookieScripts (testni-2:580)
    at Function.jQuery.cookiesDirective (user.js?ebed2ce42a4ad961c590195996b733d0:71)
    at HTMLDocument.<anonymous> (testni-2:590)
    at u (jquery.min.js?ebed2ce42a4ad961c590195996b733d0:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?ebed2ce42a4ad961c590195996b733d0:2)
    at Function.ready (jquery.min.js?ebed2ce42a4ad961c590195996b733d0:2)
    at HTMLDocument._ (jquery.min.js?ebed2ce42a4ad961c590195996b733d0:2)

Offline

#4 2021-06-16 20:39:18

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,507
Website

Re: Set Condition based on language for Bot

I ques you are calling function before lhc has initialized it’s script, just check your execution order smile

Offline

#5 2021-06-21 14:04:15

Grom
New member
Registered: 2021-06-09
Posts: 6

Re: Set Condition based on language for Bot

Hi, thank you for answers

So I managed, my chat widged is open in diferent language every time when I switch language page. But this is not work in popup mode. When I open chat in mobile, there is no posible to close popup (this is pure pain, why is no possible to have close chat button in popup?). and cookies stay there. And when I change site languge, they always open chat in language wich was first open.

Is there something I could  to solwe these issue?

Please how can I write code so it can be executed from PopUp mode, to delete  lch_cookie , console.log() and window.parent not working from popup embed.
Thank you

Offline

#6 2021-06-21 15:13:08

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,507
Website

Re: Set Condition based on language for Bot

Popup has to be closed by visitor by closing tab or ending the chat.

Offline

#7 2021-06-21 15:22:32

Grom
New member
Registered: 2021-06-09
Posts: 6

Re: Set Condition based on language for Bot

Hi, remdex
I firs I would like to say I'm really greateful I can use, this beautiful pice of software. It realy is something.

Please take a look tuamv.com here in widged work all. But in pop up (mobile) -  language bot don't want to change, and there is no close button.
I made one in HTM widged theme, but is only url to another popup. (I use two embed code). Strange is it, bot don't respect language condition in pop up, but respect in widged.

Thank you

Offline

#8 2021-06-21 15:29:56

remdex
Administrator
From: Lithuania
Registered: 2012-09-23
Posts: 3,507
Website

Re: Set Condition based on language for Bot

In short.

1. You should not be starting chat just by opening a widget. Use in widget themes "Custom content" tab and at the bottom setup triggers content you want to show.
2. I just see duplicate content, which means your configuraiton are incorrect just.

Offline

#9 2021-06-21 16:54:12

Grom
New member
Registered: 2021-06-09
Posts: 6

Re: Set Condition based on language for Bot

Hi, so I made three themes, use  se in widget themes "Custom content" tab and at the bottom setup triggers content for each language.
Use only 1 embed code wich diferent language value according to language /slo/ /eng/ /ita/  each embed code I asing correct theme for language.
And nothing changed, In embed popup on English site - Slovenian theme popup, just because I open slovenian before. PopUp dont care for languages, it seems to me.

Offline

#10 2021-06-22 21:34:26

Grom
New member
Registered: 2021-06-09
Posts: 6

Re: Set Condition based on language for Bot

So I made 3 department, 3 bots, 3 themes each for each language.
In embed code on each language I use diferent department, diferent theme, diferent boot trigger.

In mobile pop up don't want to change language, pop up url will change but content no. If there I could make somehow button to close chat pop up and delete cookie, maybe will work.

/index.php/ita/chat/start/(theme)/6/(vid)/e4ede120df7f6f8a97fc/(mobile)/true/(department)/4/(scope)/page2/(sound)/1/(leaveamessage)/true?ses_ref=//tuamv.com/
/index.php/eng/chat/start/(theme)/5/(vid)/e4ede120df7f6f8a97fc/(mobile)/true/(department)/5/(scope)/page2/(sound)/1/(leaveamessage)/true?ses_ref=//tuamv.com/

Im aut of ideas and time, after 4 days I will admit defeat sad

Anyway thank you for your help.

Offline

Board footer