How to Embed a Widget on PrestaShop

PrestaShop is one of the most popular open-source e-commerce platforms, powering hundreds of thousands of online stores. By embedding Embeddy widgets on your PrestaShop store, you can add interactive product configurators, size guides, compatibility checkers, quizzes, lead capture forms, and more — without developing a full PrestaShop module from scratch. This guide covers three methods: the built-in Custom HTML module, direct theme template editing, and creating a lightweight custom module.

Beginner-Intermediate~10 min readUpdated 2026

Prerequisites

Before you start, have the following ready:

<iframe
  src="https://embeddy.ai/webhost/WIDGET_ID?widget_props_id=PROPS_ID"
  width="100%"
  height="500"
  frameborder="0"
></iframe>
  • PrestaShop back office access. You need administrator access to your PrestaShop back office (admin panel) to install modules and edit theme files.
  • PrestaShop 1.7+ or 8.x recommended. Older versions (1.6 and below) have a different module and hook system; the core concepts still apply but file paths differ.

Always back up your theme before editing files. In PrestaShop, go to Design > Theme & Logo and export your current theme, or use FTP to back up your themes/ directory.

Method 1: Custom HTML Module

Easiest — no code required

PrestaShop includes a built-in Custom HTML (or "Custom text block") module that lets you place arbitrary HTML in any hook position on your store. This is the fastest way to embed a widget without writing any code.

  1. 1

    Install or enable the Custom HTML module

    In your back office, go to Modules > Module Manager and search for "Custom text block" or "ps_customtext". If it is not installed, click Install. If already installed, click Configure.

  2. 2

    Add your embed code

    In the module configuration, you will see a rich text editor. Switch to the Source Code or HTML view (click the "</>" icon) and paste your Embeddy iframe embed code.

  3. 3

    Choose a hook position

    Go to Design > Positions to transplant the module to your desired hook. Common hooks include displayHome (homepage), displayFooterBefore, or displayProductAdditionalInfo (product pages).

  4. 4

    Save and verify

    Click Save, then visit your storefront to confirm the widget appears in the correct position.

Tip: PrestaShop's rich text editor may strip iframe tags. Always use the Source Code / HTML view when pasting embed codes. If the editor still strips your code, disable the CKEditor sanitizer or use Method 2 instead.

Method 2: Edit Theme Templates Directly

Intermediate — requires basic Smarty knowledge

PrestaShop themes use Smarty template files (.tpl). You can embed the widget directly in a template file for full control over placement. This works on all PrestaShop versions.

  1. 1

    Locate your theme directory

    Connect via FTP or your hosting file manager. Navigate to themes/your-theme-name/templates/. The default PrestaShop 1.7+ theme is called classic.

  2. 2

    Open the target template

    Common template files include index.tpl (homepage), catalog/product.tpl (product pages), and cms/page.tpl (CMS pages).

  3. 3

    Paste the embed code

    Add the iframe at the desired position in the template. Wrap it in a container div for styling:

{* Embeddy Widget *}
<div class="embeddy-widget-wrapper" style="max-width: 800px; margin: 2rem auto;">
  <iframe
    src="https://embeddy.ai/webhost/WIDGET_ID?widget_props_id=PROPS_ID"
    width="100%"
    height="500"
    frameborder="0"
    style="border: none; border-radius: 8px;"
    loading="lazy"
    title="Interactive Widget"
  ></iframe>
</div>
  1. 4

    Clear the cache and verify

    In the back office, go to Advanced Parameters > Performance and click "Clear cache". Then visit your storefront to confirm the widget renders correctly.

Remember: If you update your PrestaShop theme, your custom template edits may be overwritten. Use a child theme or keep a backup of your modified files.

Method 3: Create a Custom Module

Advanced — survives theme updates

For the most maintainable approach, create a lightweight PrestaShop module that hooks into any display position. This method survives theme updates and can be configured from the back office.

  1. 1

    Create the module directory

    On your server, create a folder at modules/embeddywidget/.

  2. 2

    Create the main module file

    Create modules/embeddywidget/embeddywidget.php with the following code:

<?php
if (!defined('_PS_VERSION_')) { exit; }

class EmbeddyWidget extends Module
{
    public function __construct()
    {
        $this->name = 'embeddywidget';
        $this->tab = 'front_office_features';
        $this->version = '1.0.0';
        $this->author = 'Embeddy';
        $this->need_instance = 0;
        parent::__construct();
        $this->displayName = $this->l('Embeddy Widget');
        $this->description = $this->l('Embed interactive widgets from embeddy.ai');
    }

    public function install()
    {
        return parent::install()
            && $this->registerHook('displayHome')
            && $this->registerHook('displayProductAdditionalInfo');
    }

    public function hookDisplayHome($params)
    {
        return '<div class="embeddy-widget" style="max-width:800px;margin:2rem auto;">
            <iframe src="https://embeddy.ai/webhost/WIDGET_ID?widget_props_id=PROPS_ID"
                width="100%" height="500" frameborder="0"
                style="border:none;border-radius:8px" loading="lazy"
                title="Interactive Widget"></iframe>
        </div>';
    }

    public function hookDisplayProductAdditionalInfo($params)
    {
        return $this->hookDisplayHome($params);
    }
}
  1. 3

    Install the module

    In the back office, go to Modules > Module Manager, find "Embeddy Widget" in the list, and click Install.

  2. 4

    Reposition via hooks

    Go to Design > Positions to transplant the module to any hook position you need (e.g., displayFooterBefore, displayLeftColumn).

Advantage: A custom module is the cleanest approach for PrestaShop. You can extend it with a configuration page to allow store admins to update the Widget ID and Props ID from the back office without editing code.

Embedding on Product Pages

Product pages are ideal for embedding interactive Embeddy widgets. Common use cases include:

  • Size guides — help shoppers find the right fit before purchasing
  • Compatibility checkers — verify that accessories or parts work together
  • Product configurators — let customers customize options before adding to cart
  • ROI calculators — demonstrate value for high-ticket items

To embed on product pages, use the displayProductAdditionalInfo hook (Method 1 or 3) or edit the catalog/product.tpl template directly (Method 2).

For product-specific widgets, you can extend the custom module to read the product ID and display different widget configurations per product using PrestaShop's product custom fields.

Troubleshooting

The iframe is stripped from the Custom HTML module

PrestaShop's rich text editor (TinyMCE / CKEditor) can strip iframe tags for security. Switch to Source Code view before pasting. If iframes are still removed, go to Advanced Parameters > Performance and check if HTML Purifier is enabled — you may need to configure it to allow iframes from embeddy.ai.

Widget shows a blank area or infinite spinner

Verify your Widget ID and Props ID are correct. Copy the embed code fresh from the Embeddy dashboard and confirm the widget is published (not in draft mode).

Widget does not appear after cache clear

PrestaShop heavily caches templates and modules. Clear the cache from Advanced Parameters > Performance > Clear cache. Also check that the module is assigned to the correct hook via Design > Positions.

Content Security Policy (CSP) error in the console

If your PrestaShop instance or server has strict CSP headers, iframes from external domains may be blocked. Check your browser console (F12) for CSP errors. Add embeddy.ai to your frame-src directive in your server configuration or PrestaShop security module.

Widget is cut off on mobile

Ensure the iframe has width="100%". Add overflow: hidden to the wrapper div. You can also use PrestaShop's responsive CSS classes or add custom media queries in your theme's custom.css.

Frequently Asked Questions

Will embedding a widget affect my PrestaShop store's page speed?

Iframes load independently and do not block your main page render. Using loading="lazy" defers loading until the widget scrolls into view, maintaining good Core Web Vitals scores. Embeddy's CDN ensures fast global delivery.

Which PrestaShop hooks work best for embedding widgets?

The most common hooks are displayHome (homepage), displayProductAdditionalInfo (below product description), displayFooterBefore, and displayLeftColumn /displayRightColumn. You can view all available hooks in Design > Positions.

Does this work with PrestaShop multistore?

Yes. When using the module approach, you can configure different widgets per store in a multistore setup. The module will respect the current shop context. When editing templates directly, make sure you are editing the correct theme for each store.

Ready to supercharge your PrestaShop store?

Build a free interactive widget — size calculator, product configurator, quiz, or anything you need — and embed it on your store in minutes.

Create your free widget at embeddy.ai