How to Add Asyntai AI Chatbot to PrestaShop

Step-by-step guide for PrestaShop websites

Get Embed Code

Step 1: Get Your Embed Code

First, go to your Asyntai Dashboard and scroll down to the "Embed Code" section. Copy your unique embed code which will look like this:

<script async src="https://asyntai.com/static/js/chat-widget.js" data-asyntai-id="YOUR_WIDGET_ID"></script>

Note: The code above is just an example. You must copy your own unique embed code from your Dashboard as it contains your personal widget ID.

Step 2: Using Custom Code Module (Recommended)

The easiest way to add the chatbot is using a free "Custom Code" module from the PrestaShop Addons marketplace:

  1. Log in to your PrestaShop Back Office
  2. Go to Modules → Module Manager
  3. Click "Upload a module" or search the marketplace for "Custom Code" or "Header Footer Scripts"
  4. Install a module like "Custom JS and CSS" or similar
  5. Once installed, go to the module's configuration
  6. Find the "Footer Scripts" or "Before </body>" section
  7. Paste your Asyntai embed code
  8. Click "Save"

Tip: Popular free modules for this purpose include "Custom JS and CSS Pro", "Custom Code", and "Header and Footer Scripts". These modules survive theme and PrestaShop updates.

Alternative: Edit Theme Template (PrestaShop 1.7+/8)

You can add the code directly to your theme's footer template:

  1. Access your PrestaShop files via FTP or file manager
  2. Navigate to your theme folder: themes/your_theme/templates/_partials/
  3. Open the file footer.tpl (or in some themes, check templates/layouts/layout-both-columns.tpl)
  4. Find the closing </body> tag or the {block name='javascript_bottom'} section
  5. Paste your Asyntai embed code just before the closing </body> tag
  6. Save the file
  7. Clear PrestaShop cache: Advanced Parameters → Performance → Clear cache

Important: Changes to theme files may be overwritten when updating your theme. Consider using a child theme or a module for a more permanent solution.

Alternative: Using Theme's Custom JavaScript File

Many PrestaShop themes include a custom.js file for your own scripts:

  1. Navigate to: themes/your_theme/assets/js/
  2. Look for a file named custom.js (create it if it doesn't exist)
  3. Add the following code to dynamically load the chatbot:
    (function() {
      var script = document.createElement('script');
      script.async = true;
      script.src = 'https://asyntai.com/static/js/chat-widget.js';
      script.setAttribute('data-asyntai-id', 'YOUR_WIDGET_ID');
      document.body.appendChild(script);
    })();
  4. Replace YOUR_WIDGET_ID with your actual widget ID
  5. Clear PrestaShop cache

Alternative: Create a Simple Module (For Developers)

For developers, you can create a simple module using the displayFooter hook:

  1. Create a folder: modules/asyntaichatbot/
  2. Create asyntaichatbot.php with this code:
    <?php
    class AsyntaiChatbot extends Module {
      public function __construct() {
        $this->name = 'asyntaichatbot';
        $this->version = '1.0.0';
        $this->author = 'Your Name';
        parent::__construct();
        $this->displayName = 'Asyntai Chatbot';
      }
      public function install() {
        return parent::install() && $this->registerHook('displayFooter');
      }
      public function hookDisplayFooter($params) {
        return '<script async src="https://asyntai.com/static/js/chat-widget.js" data-asyntai-id="YOUR_WIDGET_ID"></script>';
      }
    }
  3. Replace YOUR_WIDGET_ID with your actual widget ID
  4. Install the module via Modules → Module Manager

Step 3: Verify Installation

After saving your changes and clearing the cache, visit your store in a new browser tab or incognito window. You should see the chat widget button in the bottom right corner. Click it to make sure it opens and works correctly.

Not seeing the widget? Make sure to clear PrestaShop's cache: go to Advanced Parameters → Performance → Clear cache. Also try clearing your browser cache or viewing in an incognito window. If using a custom module, verify it's enabled in the Module Manager.