Courtney Posted June 25, 2019 Share Posted June 25, 2019 I'm trying to add the JavaScript below to this homepage: https://st-claires.com/ It's a snippet from Mailerlite for a pop over. The only instructions Mailerlite has is: Install the following snippet of Javascript on every page of your website right before the closing </head> tag. You only need to add this snippet once, even if you plan to have a few different webforms. I tried adding it to the homepage document and it shows the code now, but no pop over Any suggestions? <!-- MailerLite Universal --> <script> (function(m,a,i,l,e,r){ m['MailerLiteObject']=e;function f(){ var c={ a:arguments,q:[]};var r=this.push(c);return "number"!=typeof r?r:f.bind(c.q);} f.q=f.q||[];m[e]=m[e]||f.bind(f.q);m[e].q=m[e].q||f.q;r=a.createElement(i); var _=a.getElementsByTagName(i)[0];r.async=1;r.src=l+'?v'+(~~(new Date().getTime()/1000000)); _.parentNode.insertBefore(r,_);})(window, document, 'script', 'https://static.mailerlite.com/js/universal.js', 'ml'); var ml_account = ml('accounts', '921623', 'g0p9i3j9l5', 'load'); </script> <!-- End MailerLite Universal --> Thanks! Link to comment Share on other sites More sharing options...
bsmither Posted June 26, 2019 Share Posted June 26, 2019 Welcome Courtney! Glad to see you made it to the forums. Using a programmer's text editor (your hosting account's control panel has one of these), you will open /skins/foundation/templates/main.php (and main.checkout.php). Here you will find the </head> tag. You should include these additional two lines of code so that the template rendering engine (Smarty) will not get confused because it uses braces that javascript also uses. {literal} Mailerlite javascript goes here... {/literal} Then, return to CubeCart's admin and edit the Homepage document. Remove the Mailerlite code from this document. Link to comment Share on other sites More sharing options...
Courtney Posted June 26, 2019 Author Share Posted June 26, 2019 Thank you bsmither! Where can I find the programmer text editor from the dashboard and open skins so I can get to the template I need to edit? I went ahead and used visual studio because I didn't know where it was. I came up with this: https://github.com/TechQueen88/snippet I just need to test the code that you sent and the one I came up with. Still trying to find open /skins/foundation/templates/main.php so I can edit the head tag, where do I find this? Thanks again! Link to comment Share on other sites More sharing options...
bsmither Posted June 26, 2019 Share Posted June 26, 2019 Do you have a hosting provider where your website is being served? If so, your hosting provider has provided for your use a hosting control panel. One such popular control panel is CPANEL. Another well-known name is PLESK. You will log in to this control panel. In there, you will find a File Manager. The File Manager has a file editing function. When you get the hosting control panel's File Manager to show you the top directory, and after you enter the 'public_html' directory, there you will find the /skins/ folder. If you are experimenting with CubeCart on a home server, that server will need to have an editor installed. CubeCart does not provide an internal editor for customizing the skin code. Link to comment Share on other sites More sharing options...
Courtney Posted June 28, 2019 Author Share Posted June 28, 2019 Got it working perfectly! Thank you so much. Only small thing is it actually says {literal} https://st-claires.com/. I guess it's not that big of a deal though. Link to comment Share on other sites More sharing options...
bsmither Posted June 28, 2019 Share Posted June 28, 2019 Return to CubeCart's admin and edit the Homepage document. Remove the Mailerlite code from this Homepage document - including the {literal} and {/literal}. After saving the edited document, be sure to click the button "Clear Cache" that is lit up in the upper-right corner. Link to comment Share on other sites More sharing options...
Courtney Posted June 28, 2019 Author Share Posted June 28, 2019 Thank you!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.