PrestaShop and Google+ badge

 
 

How to create Google+ badge

Want to create own google plus badge widget exactly the same as you can see on the left hand side here? Read this free tutorial. I will show you step by step how easily you can create own google plus badge. I willl use our free html block prestashop module. This awesome addon allows you to use any code you want in most important places (hooks) in PrestaShop store. 

 

As always I want to say, that you have to install html block module  first in your back office. It is necessary because without this module it will be hard to use this widget (You will need to edit the template files), with this addon it will be very easy.

 

Google+ widget code

Here is the widget code for our Google+ profile. Of course if you want to use widget for own profile - you have to change several variables in the code below. I will show you step by step what to change.

<!-- Place this tag where you want the widget to render. -->
<div class="g-page" data-width="200" data-href="//plus.google.com/116184657854665082523" data-rel="publisher"></div>

<!-- Place this tag after the last widget tag. -->
<script type="text/javascript">
  window.___gcfg = {lang: 'en-GB'};

  (function() {
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
  })();
</script>

 

Most important variables in the code

  1. data-width="200"  - this param defines the width of the widget block, you can use own width value (you can decrease / increase it if you want)
  2. //plus.google.com/116184657854665082523 - this is an URL to our Google+ profile. You have to use own URL inster our. Change the value of this param.
  3. window.___gcfg ={lang: 'en-GB'}; this is the definition of the language used in widget, en-GB means that widget will use english language for Great Britain.  You can use own language ISO code there, for example: pl, es, fr, de, it etc.

 

You can also define own widget code on page: Google+ widget code generator. Ok, so I suppose that you've got now own valid Google+ badge widget code. So please follow instruction below.

 

Html block and widget  code

Now it is time to use the widget code in html block module. Open your modules tab in your back office and search for html box module. This is how the module looks like in your BO.

 

html block free presatshop module in back office

html box free module

 

Click on configure button and you will see the module configuration page

html block configuration page

 

From the left hand side column select the position where you want to put the widget. I selected left column, so it mean that widget will appear in the main left column of your store. Now paste the code to the field in the right hand side column and hit Save Settings button. That's all, your widget will appear in your front - end.

 

This tutorial will work also in old prestashop versions like 1.2, 1.3, 1.4

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