Unleash the Full Potential of Your PrestaShop Store

Welcome to MyPresta.eu – Your reliable partner in the e-commerce world. Find innovative modules that will take your business to a new level.

Facebook plugins conflict, what is behind the problem?

In this article I will describe shortly the problem with usage of various facebook modules in PrestaShop. Case is very specific, related to many facebook libraries that facebook has and allows to use with their widgets / apps.

As you probably know - modules that integrates your shop with Facebook include some javascripts from Facebook usually. Without these javascripts modules will not have possibility to initiate integration so in effect modules will not work. 


Let me explain the way of how facebook apps works.
Facebook offers several javascript libraries dedicated to facebook widgets / api.  These libraries are:

  1. sdk.js - dedicated for simple widgets like likebox, pagechat etc
  2. all.js - for all widgets that sdk.js offers and also for api queries (for exmaple to get facebook user email, first and last name etc.)
  3. customerchat.js - for all widgets from sdk.js, for all api queries from all.js + for messenger support


How facebook libraries works?
If your shop uses several Facebook modules and if these modules include various Facebook's .js libraries - there is a hight risk that you will have some conflicts between these plugins. Simply saying - Facebook plugins can't work with various .js libraries. Within your website you can use only one Facebook's js library. If you will include several libraries - website will use the most basic file.

 

Facebook libraries and features that these libraries supports

facebook library Widgets
(simple widgets like likebox, pagechat)
Messenger chat
(chat bubble)
Facebook api
(facebook login etc.)
all.js
all.js + appID
sdk.js
sdk.js + appID
customerchat.js
customerchat.js + appID

 

The most advanced library that facebook offers, where all modules work is a customerchat.js library with defined appID number. It suppoers simple widgets, facebook's api integration and messenger chat bubble. If you want to use various facebook's modules - make sure that these modules give you possibility to decide what library module will load and if these modules have possibility to not include the library at all.

 

For example,

  • You want to use "facebook login" module with "messenger chat" addon. From what you can read inside table i pasted - you will need to use customerchat.js + appID.
  • You want to use "facebook likebox" module you will need all.js library
  • You want to use "facebook likebox" module with "facebook login" - you will need all.js + appID
  • etc.

 

All Facebook Modules from mypresta.eu offer gives possibility to decide about what library will be loaded and define appID. Only then you will avoid conflicts between Facebook modules.

Zdjęcie autora: Milosz Myszczuk

Artykuł napisany przez Milosza Myszczuka, eksperta PrestaShop i oficjalnego moderatora społeczności PrestaShop. CEO i założyciel agencji interaktywnej VEKIA. Dowiedz się więcej.

If you like this article, support our work!

Comments