simobf Posted March 13, 2012 Posted March 13, 2012 Buongiorno a tutti. Sto utilizzando Prestashop e vorrei capire come posso fare ad aggiungere un codice javascript in ogni pagina. Questo codice è una chat che va automaticamente a posizionarsi in basso. Precedentemente inserivo questo codice nell'header della pagina, ma con Prestashop non so dove inserirlo. Grazie per l'aiuto. Simone Share this post Link to post Share on other sites More sharing options...
sigwinstonwolf Posted May 15, 2012 Posted May 15, 2012 (edited) mi accodo alla richiesta. Ho già provato nel modo seguente ma non ha funzionato. nel file /themes/miotema/header.tpl se metto il codice javascript direttamente in questa pagina, come risultato ottengo solo una pagina bianca. Allora aggiungo un richiamo al js prima della chiusura del tag </head> e ho fatto un file JS con dentro il codice della chat online, nel mio caso era LiveChatoo <script type="text/javascript"> (function() { livechatooCmd = function() { livechatoo.embed.init({account : 'ablight', lang : 'en', side : 'right'}) }; var l = document.createElement('script'); l.type = 'text/javascript'; l.async = !0; l.src = 'http' + (document.location.protocol == 'https:' ? 's' : '') + '://app.livechatoo.com/js/web.min.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(l, s); })(); </script> svuoto la chache del browser, e svuoto anche le cartelle chache e compile dello smarty (/tools/smary/cache e compile tranne il file index.php di quest'ultima) ma niente da fare ..... se visualizzo il codice sorgente della pagina il javascript c'è ..... ma non succede nulla. se invece lo carico in un'html qualsiasi per prova ..... funziona. qualche aiuto ?? Edited May 15, 2012 by sigwinstonwolf (see edit history) Share this post Link to post Share on other sites More sharing options...
sigwinstonwolf Posted May 15, 2012 Posted May 15, 2012 Risolto. E' bastato inserire il codice javascript tra i tag {literal} {/literal} come spiegato qui: http://xbfish.com/tag/prestashop-javascript/ spero possa essere utile a qualcuno. 1 Share this post Link to post Share on other sites More sharing options...
AlbertoKite Posted June 17, 2016 Posted June 17, 2016 Ottimo Grazie Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now