fitratech/sylius-facebook-messenger-plugin

A plugin to integrate facebook messenger chat box in Sylius.


README

68747470733a2f2f6669747261746563682e636f6d2f696d616765732f6c6f676f2e706e67      68747470733a2f2f64656d6f2e73796c6975732e636f6d2f6173736574732f73686f702f696d672f6c6f676f2e706e67

Facebook Messenger

A facebook messenger plugin to embed the chat box for Sylius.

Features

enable the chat box & set the page id from the back office

enable the chat box & set the page id from the back office

inject the chat box directly via template event

inject the chat box directly via template event inject the chat box directly via template event

Installation

Require the plugin :
composer require fitratech/sylius-facebook-messenger

If you are using Symfony Flex skip the bundles.php modification.

Modify config/bundles.php to add this line at the end :

    FitraTech\SyliusFacebookMessengerPlugin\FitraTechSyliusFacebookMessengerPlugin::class => ['all' => true],

Usage

  1. Your Channel entity need to implement the FitraTech\SyliusFacebookMessengerPlugin\Model\ChannelInterface interface and use the FitraTech\SyliusFacebookMessengerPlugin\Model\ChannelTrait trait.

  2. You need to run a diff of your doctrine's migrations: bin/console doctrine:migrations:diff. Don't forget to run it! (bin/console doctrine:migrations:migrate)

  3. Override SyliusAdminBundle/Channel/_form.html.twig (if you are not familiar with template overriding check the official doc) and include @FitraTechSyliusFacebookMessengerPlugin/Channel/form.html.twig

    <div class="ui hidden divider"></div>
    {% include '@FitraTechSyliusFacebookMessengerPlugin/Channel/form.html.twig' %}
    

Front customization

You can override the chat box templates in your theme (src/FitraTechSyliusFacebookMessengerPlugin/Resources/views/embed.html.twig)

Local Development

Facebook Messenger chat box require a fully qualified domain name (FQDN) localhost & ip doesn't work, you need to setup a local domain if you use symfony cli follow the official doc and or this blog post