tawkto bring customer data

This commit is contained in:
iBNu Maksum 2024-10-22 10:34:44 +07:00
parent 53aa187d1f
commit 8086802bf6
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 119 additions and 89 deletions

View File

@ -852,5 +852,6 @@
"info": "info", "info": "info",
"Registration_code": "Registration code", "Registration_code": "Registration code",
"Admin_can_only_have_single_session_login__it_will_logout_another_session": "Admin can only have single session login, it will logout another session", "Admin_can_only_have_single_session_login__it_will_logout_another_session": "Admin can only have single session login, it will logout another session",
"Single_session_Admin": "Single session Admin" "Single_session_Admin": "Single session Admin",
"Get_Directions": "Get Directions"
} }

View File

@ -56,8 +56,34 @@
{if $_c['tawkto'] != ''} {if $_c['tawkto'] != ''}
<!--Start of Tawk.to Script--> <!--Start of Tawk.to Script-->
<script type="text/javascript"> <script type="text/javascript">
var Tawk_API = Tawk_API || {}, var isLoggedIn = false;
Tawk_LoadStart = new Date(); var Tawk_API = {
onLoad: function() {
if (!isLoggedIn) {
isLoggedIn = true;
window.Tawk_API.login({
name: '{$_user['fullname']}',
email: '{$_user['email']}',
userId: '{$_user['id']}'
}, function(error) {
//do something if there's an error
});
}
Tawk_API.setAttributes({
'id' : '{$_user['id']}',
'username' : '{$_user['username']}',
'service_type' : '{$_user['service_type']}',
'balance' : '{$_user['balance']}',
'account_type' : '{$_user['account_type']}',
'phone' : '{$_user['phonenumber']}'
}, function(error) {});
}
};
var Tawk_LoadStart = new Date();Tawk_API.visitor = {
name : '{$_user['fullname']}',
email : '{$_user['email']}',
userId: '{$_user['id']}'
};
(function() { (function() {
var s1 = document.createElement("script"), var s1 = document.createElement("script"),
s0 = document.getElementsByTagName("script")[0]; s0 = document.getElementsByTagName("script")[0];
@ -101,6 +127,7 @@
}); });
</script> </script>
{literal} {literal}
<script> <script>
var listAtts = document.querySelectorAll(`[api-get-text]`); var listAtts = document.querySelectorAll(`[api-get-text]`);
@ -159,7 +186,9 @@
} }
return null; return null;
} }
setCookie('user_language', '{/literal}{$user_language}{literal}', 365); setCookie('user_language', '
{/literal}{$user_language}
{literal}', 365);
</script> </script>
{/literal} {/literal}