!PrestaShop Social with Facebook & Instagram logo
PrestaShop Social with Facebook & Instagram (ps_facebook)
Installation
Use <code>make build</code> to install dependencies (or <code>make docker-build</code> to run it within docker).
Check other commands with <code>make help</code>.
Requirements
This module is compliant with PrestaShop 1.7+. PHP compatibility can be found in <code>composer.json</code>.
You need a facebook developper account added to the PrestaShop Social Media app (ID:726899634800479) to manage its settings.
CDN usage
If you want to use local vue app, set on your .env USE_LOCAL_VUE_APP at 1.
USE_LOCAL_VUE_APP=1
Usage
Install module and connect to FBE in module BO
Delivery
Automatic
This package should be automatically delivered by the CI/CD, see the github workflows. Zips should be available for each releases.
Manual
1. Fill up <code>.env.inte</code> and <code>.env.prod</code> files 2. Use <code>make bundle</code> to build up deliverable zips for integration and production purpose. 3. Find zips within the <code>./dist</code> directory
About
Compliancy with PrestaShop 1.6
This module is not compliant with PS 1.6 as some Pixel events could not be implemented properly on this version (i.e <code>CustomizeProduct</code>). This avoids potential misunderstanding about mismatching behavior of the module with different versions of PrestaShop.
Facebook Pixel
Based of the Facebook documentation about GDPR, a user may revoke his consent to use Pixel. This can be notified to Facebook by calling <code>fbq('consent', 'revoke');</code>. Cookies management modules are available on the PrestaShop marketplace to allow the management of Facebook features to each user.
For third-party module developers, this module will revoke the consent to use Pixel if the proper JS variable is set in the page content before the initialization of this module:
window.doNotConsentToPixel = true;
- Using Pixel event in other modules
You can call custom Pixel event by using hook: actionFacebookCallPixel
You also need to add some params in hook call
Required: + eventName + module
Optional: + id_product + id_product_attribute
Example:
Hook::exec('actionFacebookCallPixel' ,['eventName' => 'AddToWishlist', 'module' => 'wishlist', 'id_product' => $productId, 'id_product_attribute' => $idProductAttribute]);
Development
The main branch receiving all kind of contributions (bug fixes, improvements & new features) is the <code>master</code> branch.
In the future we may maintain several branches at the same time, for instance to fix the current version in production while we prepare new features for the next release. These branches would be defined as <code>[1-9].[1-9].x</code> (for instance <code>1.4.x</code>).
- Running with dev dependencies
composer install --dev
To set the build of the VueJS app in development mode and watching your changes:
cd _dev
npm run dev
- Replacing config values of the project
Some values of the Config class can be overwriten by having your own environment variables.
You can for instance have your own <code>.env</code> at the root of this project to replace the Facebook App ID or switch the API URLs to another domain.
Tests
This module follows recommandations of the PrestaShop devdocs and is checked by PHP-CS-Fixer, PHPStan and PHPUnit before each release.
Two sets of tests have been implemented in this module:
vendor/bin/phpunit tests/unit/
These tests run the calls to Facebook API to make sure the data the module relies on is still valid. It requires preliminary configuration, by setting your FBE configuration in a JSON config file.
cp tests/integration/config.json.dist tests/integration/config.json
Edit your config.json, then
vendor/bin/phpunit tests/integration/ -v
Storybook
Here available storybooks URLs according to existing environments : Integration Storybook Preproduction Storybook Production Storybook
Commenti (0)
Non è stato possibile inviare il tuo giudizio sulla recensione
Segnala commento
Segnalazione inviata
Non è stato possibile inviare la tua segnalazione