Skip to content
Plugins and integrations4 min read

Add the chat to a PrestaShop store

PrestaShop needs the snippet wrapped in literal tags so Smarty leaves it alone. There is also a no-code Custom HTML module route.

Browse topics

What it is

PrestaShop themes are built with a template language called Smarty, which treats curly braces as its own syntax. That is why the Agentency snippet for PrestaShop is wrapped in {literal} tags: they tell Smarty to print the script exactly as written instead of trying to interpret it. You paste the block into your theme's head template, clear the cache, and chat is live on every page.

There is also a no-code route that avoids theme files entirely — a Custom HTML module. Both are covered below.

When you would use it

Use this for a PrestaShop 1.7 or PrestaShop 8 store. Choose the theme-file route if you have a developer and a child theme; choose the Custom HTML module route if you would rather not touch files at all.

Where to find it

Open Dashboard → Chatbots → your chatbot → Integrations → Plugins → PrestaShop.

Before you start

  • Work in a child theme, or use the module route. A theme update overwrites the parent theme and would remove your snippet.
  • Take a backup of the template file you are about to edit.
  • Add your shop's domain, and its www form if you use one, to the widget allowlist. Multi-shop installations need every shop domain. See Allow the widget on your domains.
  • Confirm the chatbot is Active on its Playground tab.

Steps

The theme-file route:

  1. Open Dashboard → Chatbots → your chatbot → Integrations → Plugins and click the PrestaShop card.
  2. Click Copy template code. Copy the whole block, including the {literal} and {/literal} lines.
  3. On the server, open your theme's head partial: templates/_partials/head.tpl inside your theme folder.
  4. Paste the block near the end of the head section.
  5. Save the file.
  6. In the PrestaShop back office, go to Advanced Parameters → Performance and clear the cache. If you have Smarty template compilation forced off, also recompile.
  7. Open the live storefront and send a test message. Confirm it lands in Conversations.

The no-code route:

  1. Install a free Custom HTML module from the PrestaShop marketplace, or use the HTML block module your theme already ships.
  2. Paste the same snippet into the module's content, hooked to the page header.
  3. Save and clear the cache.

What the snippet looks like

The {literal} wrapper is the PrestaShop-specific part. Without it, Smarty tries to parse the braces inside the script and the page errors:

{* Add to themes/<your-theme>/templates/_partials/head.tpl, or use a Custom HTML module *}
{literal}
<script src="https://agentency.com/js/chatbot-widget.js" defer data-widget-token="wt_YOUR_WIDGET_TOKEN" data-api-base-url="https://api.agentency.com" referrerpolicy="strict-origin-when-cross-origin" crossorigin="anonymous"></script>
{/literal}

Copy your own version from the Plugins drawer — the token above is a placeholder. If you use the Custom HTML module route instead, most such modules do not run Smarty on their content, so the plain <script> line on its own is enough there.

What you will see

The back office shows nothing new after a theme edit; with the module route you see the module in your module list. On the storefront the chat bubble appears in the corner set by your chatbot's appearance settings, on the home page, category and product pages, cart, and CMS pages.

Limits and plan notes

Embedding requires a paid Agentency plan. Free is hosted-link only — see Which plans include integrations and the pricing page.

The widget does not read your PrestaShop catalogue, stock, or orders. If you want the chatbot to answer questions about specific products, either add that information as knowledge, or have your developer expose an endpoint and connect it as a Call action.

Multi-shop installations share one theme by default, so one paste can cover several shops — but each shop's domain still needs to be in the allowlist separately.

Common problems

The page shows a Smarty error after I paste.

The {literal} wrapper is missing, or only half of it was copied. Copy the whole block again.

I cleared the cache but nothing changed.

PrestaShop caches compiled templates and the page cache separately. Clear both under Advanced Parameters → Performance, and disable the page cache briefly while testing.

The snippet vanished after an update.

You edited the parent theme. Move the change into a child theme, or switch to the Custom HTML module route which survives theme updates.

Chat appears on the front page only.

Your theme overrides head.tpl per page type, or the module is hooked to a page-specific hook. Hook it to the page header hook instead.

The bubble is there but blocked.

Check the exact host in the shopper's address bar against your allowlist — including www, and any country-specific domain in a multi-shop setup. See The widget is blocked.

Common questions

Why is the snippet wrapped in literal tags?

PrestaShop themes use Smarty, which treats curly braces as its own syntax. The literal wrapper tells Smarty to print the script exactly as written.

Where exactly does it go?

Into templates/_partials/head.tpl inside your theme, or into a free Custom HTML module hooked to the page header if you prefer no file edits.

Which PrestaShop versions are covered?

PrestaShop 1.7 and PrestaShop 8. Both use the same theme structure and the same snippet.

How do I stop a theme update wiping it?

Edit a child theme rather than the parent, or use the Custom HTML module route, which theme updates never touch.

Was this article helpful?

Ready to try it on your own content?

Create a free workspace, add a document, and ask the questions your team is tired of answering.