Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Promokit AI Agent (pkaiagent)

Overview

Promokit AI Agent integrates a third-party chat/assistant (Tidio.com) into the storefront and provides lightweight visitor identification so the assistant can receive contextual information (visitor id, cart, product and customer data).

Configuration

Alysum Prestashop Theme AI Agent Configuration

  • Public Key — the module setting that contains the Tidio widget key/identifier. To get the Public Key you have to login to your tidio panel. Navigate to the Chat Page, and find the code in the Chat Page URL

How to get the Public Key:

Defaults are read from config/default.json and persisted in the module DB (DB key in src/Db/Db.php).

Used Hooks

The module uses the following hooks:

  • displayHeader — injects the pkaiagent JS config and registers scripts. If no public_key is configured, it registers only the module stylesheet (views/css/styles.css).
  • displayFixedBottomRight — renders a small button (via views/templates/hook/button.tpl) to place the assistant on the page.

Frontend behaviour (JS)

views/js/scripts.js performs these tasks:

  • Builds a JS config object with public_key (app key), user_id, user_id_pretty, and exchange_rate, plus customer info when available. This object is exported as pkaiagent via Media::addJsDef.
  • Loads the Tidio script from https://code.tidio.co/<PUBLIC_KEY>.js only when a public_key is present.
  • On Tidio ready, it prepares visitorData containing page meta (type, title, description), cart summary, customer info (logged status, email, name), and product or category info when applicable (extracted from JSON-LD when available).
  • Sets visitor data (tidioChatApi.setVisitorData) and custom styles for the chat button.