Short answer: PrestaShop's back office has no field for your own scripts, so a live chat snippet goes into the theme. The clean way in PrestaShop 8 and 9 is a two-file child theme that adds the snippet to the end of layouts/layout-both-columns.tpl, wrapped in {literal}…{/literal} so Smarty leaves the JavaScript alone. Upload it as a zip under Design → Theme & Logo, activate it, then click Clear cache under Advanced Parameters → Performance. If your chat tool ships its own PrestaShop module, use that instead.
Below: which method fits your shop, why chat snippets break PrestaShop pages, the two files you can copy, what activating a theme quietly resets (most guides skip this), and how to test. We checked the steps against the PrestaShop 9.1 source code and the current Classic and Hummingbird themes in November 2026.
Pick your method first
PrestaShop runs about 138,900 live stores, most of them in France, Spain, Poland and Italy (Store Leads, November 2026). Many of those stores were set up years ago, which is why most "PrestaShop live chat" guides still tell you to edit footer.tpl over FTP. That still works, but there are better options now.
| Method | Good for | Survives theme updates | Watch out for |
|---|---|---|---|
| The chat tool's own PrestaShop module | Tools that offer one, such as Smartsupp | Yes | Only exists for some tools |
| PrestaShop's Online Chat module | Answering from the PrestaShop back office | Yes | Conversations stay inside PrestaShop |
| Google Tag Manager | Shops that already load GTM | Yes | Needs a consent setup |
| A two-file child theme (this guide) | Any tool that gives you a <script> snippet |
Yes | Activating a theme re-applies some settings |
| Editing your theme's files directly | A quick test on a copy of the shop | No, updates overwrite it | Keep a backup |
Our opinion: if your tool has an official module, install it and stop reading. If it gives you a snippet, use a child theme. Avoid editing the theme itself on a live shop, because the next theme update deletes your change without warning.
Shopxare has no PrestaShop module today. You install the Messenger with the snippet below and connect your orders separately (see the end of this guide). If you already run Google Tag Manager on the shop, our Google Tag Manager live chat guide is the faster route.
Why chat snippets break PrestaShop pages
PrestaShop templates (.tpl files) are written in Smarty, and Smarty reads { and } as the start and end of its own tags. Chat snippets are full of curly braces. By default Smarty ignores a brace followed by a space, so a neatly formatted snippet sometimes works by luck. A minified one, like function(){...}, makes Smarty try to parse JavaScript as a template tag, and you get a blank page or an error.
The fix is to wrap the whole snippet in {literal} and {/literal}. Smarty outputs everything between them as plain text. Do this even if your snippet looks safe; it costs nothing.
Step by step: add live chat with a two-file child theme
1. Find your theme's folder name
Open Design → Theme & Logo. The active theme is shown at the top. New PrestaShop 9.1 installs use Hummingbird by default, while shops installed earlier or upgraded usually run Classic (PrestaShop 9.1 release notes). The folder names are hummingbird and classic. A theme you bought has its own folder name in /themes/; it is also the name: line in that theme's config/theme.yml.
2. Copy your chat snippet
In Shopxare, open Settings → Messenger → Install, choose HTML and click Copy. The code already contains your App ID (install guide).
3. Create two files
Make this folder structure on your computer:
chat-child/
├── config/
│ └── theme.yml
└── templates/
└── layouts/
└── layout-both-columns.tpl
config/theme.yml (change classic to your theme's folder name):
parent: classic
name: chat-child
display_name: Classic + live chat
version: 1.0.0
assets:
use_parent_assets: true
templates/layouts/layout-both-columns.tpl:
{extends file='parent:layouts/layout-both-columns.tpl'}
{block name='hook_before_body_closing_tag'}
{$smarty.block.parent}
{literal}
<script>
window.Shopxare = window.Shopxare || function () { (Shopxare.q = Shopxare.q || []).push(arguments) };
Shopxare('boot', { app_id: 'YOUR_APP_ID' });
</script>
<script async src="https://app.shopxare.com/widget/v1/loader.js"></script>
{/literal}
{/block}
Why this file and this block: in both Classic and Hummingbird, every other page layout (full width, left column, right column, content only and the error page) extends layout-both-columns.tpl. The hook_before_body_closing_tag block sits just before </body>, which is where chat snippets belong. {$smarty.block.parent} keeps the displayBeforeBodyClosingTag hook that other modules use, so you add your chat without removing anything.
You don't need a preview image or copies of the other templates. PrestaShop reads the parent theme's theme.yml settings and falls back to the parent's files for everything your child theme doesn't contain. The name must match the folder name and use only letters, numbers, - or _ (PrestaShop: creating a child theme).
4. Zip it the right way
PrestaShop looks for config/theme.yml at the top of the zip. Select the config and templates folders themselves and compress those two, not the chat-child folder around them. On a Mac: select both, right-click, Compress 2 items. On Windows: select both, right-click, Send to → Compressed (zipped) folder.
5. Upload the theme
Go to Design → Theme & Logo → Add new theme, choose Import from your computer, pick the zip and click Save (PrestaShop user guide: Theme & Logo). If you prefer FTP, upload the chat-child folder into /themes/ instead.
6. Read the next section, then activate
Back on Theme & Logo, hover over the new theme and click Use this theme. In multistore, pick the single shop first.
What activating a theme resets
When PrestaShop activates a theme, it re-applies the global_settings from that theme's theme.yml. A child theme inherits them from its parent. In the 9.1 source, activation sets configuration values, enables and disables modules, hooks and unhooks modules, and applies image sizes.
- Classic: the effect is small. It sets image quality to PNG and makes sure Classic's standard modules are enabled.
- Hummingbird: it also sets the number of featured, new and best-selling products shown on the home page to 4, disables the wishlist, brand list and supplier list modules, and unhooks a few modules from the footer and search positions.
- A theme you bought: open its
config/theme.ymland read theglobal_settingssection. Some themes enable or reset a long list of modules.
If you changed any of these since you installed the theme, write your settings down first, or try the child theme on a staging copy. If you'd rather not touch the theme at all, use Google Tag Manager or a "custom code" module from PrestaShop Addons that prints your snippet in the displayBeforeBodyClosingTag hook.
Clear the cache and test
- Go to Advanced Parameters → Performance. While you work on templates, set Template cache to Recompile templates if the files have been updated.
- Click Clear cache at the top of the page (PrestaShop user guide: Performance).
- Open the shop in a private window, go to a product page, click the chat button and send a test message. With Shopxare it reaches the inbox within a second.
- Add something to the cart and open the checkout. The chat should be there too.
- View the page source and search for
loader.js. It should appear once.
If something goes wrong
| What you see | Likely cause | Fix |
|---|---|---|
| Blank page or error 500 after activating | Smarty syntax error, usually a missing {literal} or a typo |
Re-activate the parent theme on Theme & Logo, fix the file, upload again |
| Snippet is not in the page source | Template cache | Click Clear cache again; check the Template cache setting |
| Snippet is in the source, but no chat button | Domain list in the chat tool, a consent tool blocking it, or an ad blocker | In Shopxare, check Settings → Messenger → Security; test without extensions |
| Two chat buttons | A module or a GTM tag also loads a chat | Keep one, remove the other |
| Chat disappeared after a theme update | The snippet was in the parent theme's files | Move it into the child theme |
To see the actual Smarty error, turn on Debug mode on the same Performance page for a few minutes, then turn it off again.
Still on PrestaShop 1.6?
Open themes/<your-theme>/footer.tpl, paste the snippet just before </body>, wrap it in {literal}…{/literal} and clear the cache under Advanced Parameters → Performance. Keep a copy of the file, because a theme update overwrites it.
Cookie consent
With the snippet in the theme, the chat loads for every visitor before they make a cookie choice. Whether that's acceptable depends on your country's rules and on what the chat stores in the browser. If your consent module can block scripts by category, set the chat up there. Our live chat GDPR checklist goes through the details.
Connect your PrestaShop orders
A chat that can see orders answers "where is my order?" without anyone opening the back office. In Shopxare, go to Settings → Stores & marketplaces → Connect a store, choose PrestaShop and paste the keys the window asks for (Stores and orders). After that:
- your team sees the customer's orders next to the conversation and can send an order card with status, items and tracking;
- customers can track an order from the Messenger home with the order number and the email or phone they used, once you turn on the Order tracking card;
- Are AI answers order questions from live order data, and can suggest products when you turn on the shopping assistant.
Example: a tea shop in Lyon
A three-person tea shop runs PrestaShop 8 on Classic. The owner used to answer emails each morning; questions about delivery dates piled up overnight. They build the two-file child theme in an afternoon, activate it (Classic changes almost nothing), connect the store and add their shipping page to Are AI's knowledge.
At 22:10 on a Wednesday:
Customer: Order 4821, will it arrive before Saturday? It's a birthday present.
Are AI: Order 4821 left on Tuesday with Colissimo, and tracking shows delivery planned for Friday. Here's the tracking link: [link]. If it hasn't arrived by Friday evening, reply here and the team will check with Colissimo first thing Saturday.
Nobody had to look anything up the next morning.
Try it on your PrestaShop store
The Shopxare free plan includes the Messenger, 2 seats, unlimited conversations, 1 connected store and Are AI with 50 AI resolutions a month, with no credit card (pricing). The free Messenger shows Shopxare branding. If you want something you install from the PrestaShop back office without creating any files, a tool with an official PrestaShop module is the simpler choice.
FAQ
Where do I paste live chat code in PrestaShop?
There is no field for it in the back office. Put it in a child theme, in the hook_before_body_closing_tag block of templates/layouts/layout-both-columns.tpl, wrapped in {literal}…{/literal}. Alternatives are Google Tag Manager or a module that prints custom code in the displayBeforeBodyClosingTag hook.
Why does my PrestaShop page break after I add JavaScript?
Smarty treats curly braces as template tags. Wrap the script in {literal} and {/literal}, then clear the cache under Advanced Parameters → Performance.
Is there a free live chat for PrestaShop?
Yes. Several chat tools have free plans that work with a snippet or a module, and PrestaShop has its own Online Chat module on Addons (check its current price there). Shopxare's free plan includes the Messenger, 2 seats and unlimited conversations.
Does a live chat slow down PrestaShop?
A well-built widget loads asynchronously, so the page renders first. The Shopxare loader uses async. Check your product page in PageSpeed Insights before and after if you want to be sure.
Can I add WhatsApp chat to PrestaShop?
Yes, with a WhatsApp button module or a chat tool that has a WhatsApp channel. In Shopxare, WhatsApp, Instagram and Facebook Messenger channels are on the way; today the inbox covers the website chat, email, Telegram and marketplace messages.