I've noticed that many merchants want to add a Facebook widget comments plugin to own CMS page in shop based on PrestaShop engine. In this short guide i want to show you how easily you can do that, without modification of controllers. This guide contains description related to only two files modification: cms.tpl + header.tpl file
Header.tpl file modification
Header.tpl file contains all important codes in <header> section of your website. Usually in this part of website we include js scripts, css files, script codes etc. In this case we will include facebook libraries. If you use default theme, this file is located in this path: /themes/default/header.tpl so please open it.
Right after <body> code paste this:
{literal} <div id="fb-root"></div> <script>(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_GB/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> {/literal}
This code uses en_GB language iso code, if you want to use other languages, instead en_GB just use own country code. You can find list of codes related to languages here: facebook language local codes. So, now it's time to include comments widget to your CMS pages.
Cms.tpl file modification
Cms.tpl file is a template file located in your theme directory, for default theme the path for file is: /themes/default/cms.tpl. This file contains code for CMS page in your store.
at the end of this file paste this code:
<div class="fb-comments" data-href="http://{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}" data-numposts="5" data-colorscheme="light"></div>
Effects of modification: