Jump to content

Where to paste script for popup on home page


johnmoore84

Recommended Posts

Hello, I use lead pages for creating pop up newsletter opin but I do not no where to paste the code on prestashop.

 

I tried pasteing it into the cms but I get an error message, dont think it likes the codes.

 

The code I have is below, any idea where I should paste it.

 

<script data-leadbox="14182cd73f72a2:14f11bcdcb46dc" data-url="https://my.leadpages.net/leadbox/14182cd73f72a2%3A14f11bcdcb46dc/5672749318012928/" data-config="%7B%22type%22%3A%22time%22%2C%22settings%22%3A%7B%22seconds%22%3A5%2C%22days%22%3A0%2C%22views%22%3A0%7D%7D" type="text/javascript" src="//my.leadpages.net/leadbox-789.js"></script>

 

Thanks

 

John

Link to comment
Share on other sites

You could put it in your header file, and check if the front page is loading:

 

edit /themes/default-bootstrap/header.tpl   (Make backup!!!)

<!DOCTYPE HTML>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7 " lang="{$lang_iso}"><![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7" lang="{$lang_iso}"><![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9 ie8" lang="{$lang_iso}"><![endif]-->
<!--[if gt IE 8]> <html class="no-js ie9" lang="{$lang_iso}"><![endif]-->
<html lang="{$lang_iso}">
	<head>

{* add this code block here *}
{if $page_name =='index'} {* test if we are on the front page *}
    <script data-leadbox="14182cd73f72a2:14f11bcdcb46dc" data-url="https://my.leadpages.net/leadbox/14182cd73f72a2%3A14f11bcdcb46dc/5672749318012928/" data-config="%7B%22type%22%3A%22time%22%2C%22settings%22%3A%7B%22seconds%22%3A5%2C%22days%22%3A0%2C%22views%22%3A0%7D%7D" type="text/javascript" src="//my.leadpages.net/leadbox-789.js"></script>
{/if}
{* --end-- *}

		<meta charset="utf-8" />
		<title>{$meta_title|escape:'html':'UTF-8'}</title>
{if isset($meta_description) AND $meta_description}
		<meta name="description" content="{$meta_description|escape:'html':'UTF-8'}" />
{/if}

Not sure, but it seems to load every time. Customer might get crazy. Maybe add some cookie or so that checks if it popped up before already. That's up to you...

 

pascal

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...