Facebook like box in responsive popup

If you're wondering how to create welcome popup modal window with feature called "facebook like box" - this guide is what you're looking for. In this article i will describe step by step whole process. The effect of this guide will be responsive modal window that will appear once someone will connect to your website and inside this window module will display popular facebook page plugin   (old name: facebook like box). Popup will appear only one time. Example of this responsive window you can find below:

 

responsive facebook like box prestashop

 

 

How to create popup with facebook like box ?

Whole guide is based on responsive popup pro module - it is necessary. So if you doesnt have it - download and install it in your shop. Then open module configuration page and hit button to create new popup. To create exactly the same popup as above, please fill out popup creation form with these options:

Name Facebook Like Box
Active Yes
Test Mode No
Display Popup once again after 2628000
Popup border 8
Popup border color 000000
Popup background (window) FFFFFF
Popup overlay color (background) 000000
Popup overlay opacity 0.7
Disable default "close popup" button No
Disable "click anywhere" to close popup Yes
Appearance delay 0

All options below "appearance delay" are not necessary
you can now define contents of the popup

 

Facebook like box widget code

Now we have to prepare facebook likebox widget code. All that we have to do is copy to clipoboard code below

    <div id="fb-root"></div> <script type="mce-text/javascript">// <![CDATA[ (function(d, s, id) { var
    js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
    fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); // ]]></script> <div class="fb-page"
    data-width="180" data-href="https://www.facebook.com/MyPresta" data-small-header="false" data-adapt-container-width="true"
    data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"></div></div>

Now back to popup pro configuration page, and turn on "Desktop View" section, where you can define width and height of the popup, and where you can define popup contents. Define Popup width to 516 and Popup height to 234.  Inside rich text editor turn on source code tool and paste the code you copied from above. You can see reference below:

tinymce source code tool in prestashop

 

Now you can save changes and you will have popup window with MyPresta fanpage . If you want modal window with like box of your facebook page - inside the code you copied change the "data-href" param to link to your facebook fanpage. I mean:

    data-href="https://www.facebook.com/MyPresta"

to:

    data-href="https://www.facebook.com/Your-Fanpage-Here"

 

How to create responsive popups?

As you probably noticed, popup pro module allows to create responsive popups with different contents for selected device type. Module configuration page - there where you define settings of the popup - contains 3 sections related to contents. Desktop view, Tablet view and Mobile View. Above we defined desktop view, if you want to display popup also on other deviced you have to define contents for other types. Below you can find the best settings and code for like box for each device type:

 

Tablet view:

Popup width: 516, Popup height: 234, and code to copy-paste:

    <div id="fb-root"></div> <script type="mce-text/javascript">// <![CDATA[ (function(d, s, id) { var
    js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
    fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); // ]]></script> 
    <div class="fb-page" data-width="500" data-href="https://www.facebook.com/MyPresta" data-small-header="false" data-adapt-container-width="true"
    data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"></div></div>

 

Mobile view

Popup width: 196, popup height: 247, and code to copy-paste:

    <div id="fb-root"></div> <script type="mce-text/javascript">// <![CDATA[ (function(d, s, id) { var
    js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7";
    fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); // ]]></script> 
    <div class="fb-page" data-width="180" data-href="https://www.facebook.com/MyPresta" data-small-header="false" data-adapt-container-width="true"
    data-hide-cover="false" data-show-facepile="true"><div class="fb-xfbml-parse-ignore"></div></div>
author milos myszczuk
Article by Milosz Myszczuk PrestaShop expert, official PrestaShop community moderator. PHP developer, specialist in relative and spatial databases management, GIS Analyst, CEO & founder of VEKIA interactive agency. Read more about VEKIA company
If you like my articles and want much more valuable tips, feel free to send me donation
1.4 version 1.4.11 1.6 404 addon admin advertise ahref ajax alpha animation api app application authentication back office backup badge banner basics block bootstrap button cache carrier cart catalog category certificate changelog chat class clear client clip cms code colors columns comments configuration contact container content controller cookie counter country coupon css csv currency customer dashboard database debug default delete delivery desktop developer device disable discount displayNav displayTop download dynamic editor effect empty encrypt engine error exchange exclude export facebook faceshop fade fancoupon fancybox fanpage fatal feature feed field file fix fixed font footer free friendly url front ftp full gallery generate gift global godaddy google google+ gray grid groupon header help hide highlight homefeatured homepage hook hosting hover howto htaccess html html5 ID image import include input instagram installation integration iPhone issue javascript jquery kgb knowhow languages law left likebox link list livingsocial loading log login logo loyality mail mailing maintenance manufacturer marketing marquee mcrypt menu meta mobile modification module movie moving multilanguage multiupload must have mysql news newsletter notification number open graph order override page password performance PHP phpmyadmin picture pinterest plugin popup post prestashop prestashop 1.0 prestashop 1.1 prestashop 1.2 prestashop 1.3 prestashop 1.4 prestashop 1.5 price rules problem product profile promotion proslider purifier quantity query quick tip random rates register reinsurance release reporting reset responsive restore results ribbon rich text right sales search security seo service shadow share shipping shop shopmania slider smarty social networks SQL SSL statistics stock store style subcategory superuser support switcher tab tablet tag tax template text theme tinyMCE tips and tricks tpl tracking translations tree trends trigger tumblr tutorial twitter update upgrade upload variables video visits voucher vulnerability web2print wide widget width window wishlist wysiwyg youtube zip zopim