PrestaShop chatbot: how to install it and test the cart

Desk with a planner and coral sticky notes for planning a rollout

On Sunday evening a customer writes that they need a hundred M10x30 stainless steel screws and asks what a box will cost. A simple question. To answer it well, a PrestaShop chatbot has to know the price of one specific variant and put exactly that combination into the cart, and pasting in the chat window is the easiest part of the job. Below you will find where to add the script in versions 1.7 to 9, how to give the bot access to your catalogue and how to test the whole thing on a product with variants.

What a PrestaShop chatbot consists of

The first part is the chat window, a piece of script loaded on every page of the shop. The second is data. A bot that is going to advise on screws has to know which variants you have in the catalogue and what they cost after discounts. Vendor instructions blur these two steps together, although they break in completely different places.

If you just want to talk to customers yourself, an ordinary live chat module is enough. PrestaShop Addons has a separate section for them, with Smartsupp among others. A contact form is even simpler. Its messages land in Customers > Customer Service, provided that contact has message saving switched on under Shop Parameters > Contact. An AI bot makes sense when questions arrive in the evening and at weekends and the answer sits in your catalogue.

CartBot is not a PrestaShop module. The chat window is one line of script, and we read the catalogue through the shop API, a product feed or a CSV file.

Which PrestaShop version you have and what follows from it

You can check the version under Advanced Parameters > Information. The chat script runs in the customer's browser, so the version number alone will not stop it.

On 1.7 you paste it the same way. But since the release of PrestaShop 9.0 in June 2025 that branch has not received security fixes. If you are planning an upgrade anyway, do it before installing the chat, otherwise you will run every test in this article twice.

The theme often matters more than the number. Up to version 9.0 the default was Classic, and from 9.1 new shops get Hummingbird. A theme bought on Addons also has templates of its own. A bot that puts products in the cart and selects variants talks to the theme directly, which is why we say plainly that our test passed on PrestaShop 8.2.7 with a Classic-based theme. On Hummingbird or a heavily modified template, check the cart and variants on your own shop before the bot goes live.

Where to paste the chat script in PrestaShop

It is simplest when the chat vendor has a module. You install it under Modules > Module Manager > Upload a module and the module places the window on the page by itself. Before buying, compare the required shop version on its Addons page with yours.

Without a module you add a line to the template. In the Classic and Hummingbird themes the main page layout is the file templates/layouts/layout-both-columns.tpl in the theme directory, which the other layouts build on. Find the line {hook h='displayBeforeBodyClosingTag'} in it. The closing </body> tag is a few lines below, and you paste the script right before it. That is how we added CartBot to our demo shop on PrestaShop 8.2.7, and then we cleared the template cache. In the back office, the “Clear cache” button under Advanced Parameters > Performance does that.

Watch out for two things. A theme update will overwrite your change, so it is safer to make it in a child theme, which PrestaShop provides precisely so that the parent theme can keep being updated. The second matter is curly braces. Smarty, PrestaShop's template language, reads { and } as its own commands, so if the vendor sent code with a block of JavaScript inside, wrap it in {literal} and {/literal} tags. A line that only loads a script file has no braces.

If you have Google Tag Manager in your shop, add the chat script as a tag. The theme files then stay untouched.

Catalogue access through the PrestaShop API

An AI bot has to read your catalogue. In PrestaShop the cleanest way is the built-in API, found in the Polish back office under Zaawansowane > API and in English under Advanced Parameters > Webservice. PrestaShop 9 also has a separate Admin API next to it, so do not mix them up. Switch “Enable PrestaShop's webservice” to Yes, click “Add new webservice key”, generate a key and note in the description who it is for.

In the permissions, tick only the “View (GET)” column. The bot needs read access to products, categories and combinations with stock levels, among other things, and if it should also check order status, orders and customers are added. The PrestaShop documentation explicitly advises against giving one key all rights to all resources. If the back office shows a message that the webservice endpoint does not work, ask your hosting provider to enable URL rewriting.

The catalogue is not read live on every question. Synchronisation runs on a schedule, so a new price appears in the chat with a delay and a withdrawn product disappears only after a grace period. In our test, importing 8,846 products from PrestaShop 8.2.7 took 48 seconds, with not a single rejection. PrestaShop itself calculated the gross prices, already after promotions, and for the default variant they matched the product page to the grosz. The free delivery threshold and return rules the bot takes from the shop's knowledge base, which catalogue synchronisation does not touch.

Testing answers and adding to the cart

Take a product with variants that you know by heart and walk the whole customer journey with the bot. In our demo shop, a question about a stainless M10x30 screw ended with a product card where the customer first chose the material and then the packaging. The PrestaShop cart received the item “Stainless A2 (304) + Box of 500 pcs”. On your shop, check these points.

  • The price on the card in the chat matches the product page for the same variant, also during a promotion.
  • Exactly the chosen combination goes into the cart, and the header counter shows the new item after a page refresh at the latest.
  • For a quantity above the stock level the shop refuses with its own message, and the bot passes that refusal on to the customer.
  • For a product whose variant group has more than six options, the bot sends the customer to the product page.
  • A price changed in the back office shows up in the chat, and you know after how long.
  • An order status question with a number or reference from the email and someone else's email address returns no data.
  • The test cart is visible under Orders > Shopping Carts just like any other.

How to undo the chat installation

Write down right away what you changed. In six months nobody will remember. You remove a script from the template by deleting that single line and clearing the cache under Advanced Parameters > Performance. You switch off or uninstall a module in the Module Manager, and you pause a tag in Google Tag Manager and publish a new container version.

You can disable the API key at any time under Advanced Parameters > Webservice by changing its status, or delete it entirely. Without the key the bot can no longer fetch new catalogue data or check any order.

If you would rather hand this job off, we offer setup and running of the bot as a subscription from PLN 50 net per month. Write to us and we will show it to you on your own PrestaShop catalogue before you pay anything.

Try CartBot in your store

Quote within 24 h. No commitment, no card.