ahmedkhd/sylius-bot-plugin

Sylius Bot for publishing your store on messenger and start receiving orders from outside the front store.

Installs: 495

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 2

Type:sylius-plugin


README

Sylius Bot Plugin

Facebook messenger shopping for sylius to give your store a new shoping experience

!!!! ⚠️ Sylius Version Support

  • master branch supports sylius version 1.8 & 1.9
  • 1.12 branch supports sylius version 1.12

Screenshots

Screenshot Screenshot Screenshot

Pre-installation

Installation

  1. Install using composer

    composer require ahmedkhd/sylius-bot-plugin
  2. Add this to .env

    APP_URL=<ngrok-link>
    FACEBOOK_APP_ID=<fb-app-id>
    FACEBOOK_APP_SECRET=<fb-app-secret>
    FACEBOOK_GRAPH_URL=<fb-graph-url>
    FACEBOOK_GRAPH_VERSION=<fb-app-version | v15.0>
    FACEBOOK_VERIFICATION=<you-personal-verify-token | sylius>

    Note : feel free to change the FACEBOOK_VERIFICATION token as you need (this value will be used via facebook to verify the webhook).

  3. Add the following import to _sylius.yaml:

    imports:
        # ...
        - { resource: '@SyliusBotPlugin/config/config.yml' }
    
  4. Import routes inside your routes.yml

    sylius_bot_plugin_admin:
        resource: "@SyliusBotPlugin/config/admin_routing.yml"
        prefix: /admin
    
    sylius_bot_plugin_sylius_bot:
        resource: "@SyliusBotPlugin/config/routes.yml"
  5. Run ```shell php bin/console doctrine:schema:update --force yarn build bin/console assets:install bin/console cache:clear

    
    
  6. Start ngrok with ngrok http 80

    warn : sometimes there is an issue with facebook and can't accepts ngrok requests sometimes using this command helps ngrok http https://localhost:80 --host-header="localhost:80"

  7. open Developers facebook platform > Messenger > Settings

    Callback URL : <NGROK_LINK>/webhook/messenger
    Verify Token : value of this env FACEBOOK_VERIFICATION
  8. login to sylius admin dashboard and got to Messenger tab and click on Facebook Login button and choose your pages

  9. go to second tab Persistent Menu and update your bot persistent menu and getting started button message

    IMPORTANT every bot should have persistent menu to fulfill the shopping experience on messenger

  10. That's it 😄 open your page and start talking to you bot 🎉

Contribution