Skip to content
Platforms · 7 min read

Web push notifications for PrestaShop

PrestaShop runs on your own hosting, so it’s one of the easiest stores to add web push to: one file in the shop root, one line in your theme. Here’s the setup, the cache step people forget, and a push plan for a shop.

Updated By the Pusharoo team
In short
  • Upload sw.js to the shop root — the folder with index.php — so /sw.js opens.
  • Add the snippet to themes/your-theme/templates/_partials/head.tpl, ideally in a child theme.
  • Clear the cache in Advanced Parameters → Performance after editing templates.
  • Cart reminders and order notices use Pusharoo events, automations and the REST API.

1. Put sw.js in the shop root

Every web push service has the same requirement: browsers only deliver push to a service worker served from your domain, and Pusharoo registers its worker with scope /, so https://yoursite.com/sw.js must open as JavaScript. Platforms where you control the web root make this a one-minute job; hosted platforms that don’t let you place a root file need a workaround or won’t work.

On PrestaShop, the root is the folder that contains index.php, config/ and themes/. Upload sw.js there with SFTP or your host’s file manager. If your shop lives in a subfolder (example.com/shop/), the worker still needs to be at example.com/sw.js.

curl -o /path/to/prestashop/sw.js https://pusharoo.com/sw.js

2. Add the snippet to your theme

PrestaShop has no core “custom code in head” field, so the cleanest place is the theme’s head.tpl. Use a child theme so a theme update doesn’t remove it:

{* themes/your-child-theme/templates/_partials/head.tpl *} {extends file='parent:_partials/head.tpl'} {block name='head_seo' append} <script src="https://pusharoo.com/sdk/pusharoo.js" data-site="pk_your_site_key" async></script> {/block}

Block names vary by theme; if yours differs, copy the parent head.tpl into the child theme and paste the script just before </head>. Smarty treats curly braces specially, but this snippet has none, so no {literal} tags are needed. Modules that inject “custom HTML in header” via the displayHeader hook also work.

3. Clear caches

After saving, open Advanced Parameters → Performance and click Clear cache. If you use a CDN or full-page cache module, exclude /sw.js from caching and make sure no optimization step rewrites it. The snippet loads asynchronously, so “Combine, Compress and Cache” for JavaScript doesn’t need to touch it — if something looks wrong, test with CCC off first.

4. Cart reminders and order notices

PrestaShop themes trigger a JavaScript event when the cart updates. Listen for it and tell Pusharoo; then fire a purchase event on the order confirmation page:

// theme custom.js — PrestaShop 1.7+/8 themes emit 'updateCart' if (window.prestashop) { prestashop.on('updateCart', function (e) { if (e && e.reason && e.reason.linkAction === 'add-to-cart') Pusharoo.track('added_to_cart'); }); } // on the order-confirmation template Pusharoo.track('purchase');

Create an automation “added_to_cart → wait 1 hour → reminder, stop if purchase” (details). For “your order has shipped”, call the REST API’s POST /api/v1/notify from a small module or order-status hook with the subscriber IDs you stored from the subscribe webhook.

A simple shop calendar

  • Welcome automation with this week’s bestsellers.
  • One scheduled campaign a week to “seen in the last 30 days”.
  • Seasonal peaks from the holiday calendar.
  • A monthly win-back to subscribers inactive for 45+ days (win-back guide).

Test checklist

  1. Open https://yoursite.com/sw.js — you should see JavaScript, not a 404 or your theme’s error page.
  2. Open the site in Chrome, wait for the prompt and allow twice.
  3. Check that the subscriber count rises in the dashboard, then send yourself a test.
  4. Repeat on Android, and on iPhone after adding the site to the Home Screen (testing guide).

Questions

Do I need a PrestaShop module for push notifications?

No. A file in the root and a line in your theme are enough with Pusharoo. Modules are an option if you prefer not to edit templates.

Does it work on PrestaShop 1.7, 8 and 9?

Yes — the steps are the same: root file plus the snippet in the head template. Theme block names can differ.

Will multistore work?

Add each shop’s domain as a separate website in Pusharoo and use that site key on its theme. Each domain needs its own /sw.js.

Can I segment PrestaShop shoppers by category?

Yes: call Pusharoo.tag('category', 'shoes') in your category or product template and target that tag in campaigns.

Does push work with PrestaShop’s cookie consent modules?

Pusharoo sets no cookies; if your consent module blocks scripts by category, classify the snippet according to your privacy policy.

More in Platforms: Web push for WordPress and WooCommerce · Web push on Shopify: what works, honestly · Web push on Wix, Squarespace and Webflow · Web push notifications on BigCommerce · Web push notifications for Joomla · Web push notifications for Drupal · Web push notifications for Ghost blogs · All guides

Free for life. No limits.

Unlimited subscribers, campaigns and automations. No badges. About five minutes to install.