Hello,
I want to use a live chat software in my multi language prestashop webshop (1.6).
Per language there is a chat widget with its corresponding html code, which I need to place inside the body tag of the webshop.
This is the code I placed in my header.tpl
<script>
(function() {
var hostname, insertScript, widget_com, widget_nl;
widget_nl = "bb3dbbbf230546b";
widget_com = "dc818cfdfb5376e";
insertScript = function(id) {
var src;
src = "//s3-eu-west-1.amazonaws.com/userlike-cdn-widgets/" + id + ".js";
return document.write('\x3Cscript type="text/javascript" src="' + src + '">\x3C/script>');
};
hostname = document.location.hostname;
if (hostname.match(/\.com$/)) {
return insertScript(widget_com);
} else {
return insertScript(widget_nl);
}
})();
</script>
</body>
However I can only make one language widget work for both language in my webshop.
I don't know much about html and such, so can someone pleas help me?
kind regards,
Kristof