Developer reference
Hooks, embed markup, the render endpoint, CSS hooks, JavaScript events, files, database tables and upload security.
Smarty hook
{hook h='displayImageMapPro' project='living-room'}
{hook h='displayImageMapPro' id=12}
project takes the slug, id the project ID. Prefer the slug: IDs change when projects are restored from a backup. The home page uses displayHome, registered and unregistered automatically by Module settings → Home page project.
Embed markup
<!-- Recommended: survives editors that strip data attributes -->
<div class="impro-embed impro-project-living-room"></div>
<!-- Alternative -->
<div class="impro-embed" data-project="living-room"></div>
The front script, loaded on every page through displayHeader, finds these elements, requests the map in the page's language and renders it in place.
Render endpoint
index.php?fc=module&module=impro&controller=api&a=render&project=living-room
index.php?fc=module&module=impro&controller=api&a=render&id=12
/module/impro/api?a=render&project=living-room (friendly URLs)
- Without extra parameters it returns an HTML fragment — the data the embed script injects. Opened on its own it shows only the image, because the map's CSS and JavaScript are not part of the fragment.
- Add
&standalone=1(or&embed=iframe) for a complete page that loads its own assets, for an iframe or a direct link. PrestaShop sendsX-Frame-Options: SAMEORIGIN, and add-to-cart needs the shop session, so frame it on the same domain.
Scheduled maps outside their window are not rendered by any of these routes.
CSS hooks
Every shape carries a stable data-impro-shape attribute with its internal ID, such as s_k3j9x2ab. Find it with your browser's inspector, then target it from the project's Custom CSS or your theme:
[data-impro-shape="s_k3j9x2ab"] { filter: drop-shadow(0 0 6px #fff); }
The ID stays the same when you edit, export or import the project.
JavaScript events
The storefront pushes these events to window.dataLayer, calls gtag('event', …) when GA4 is loaded and fbq('track', 'AddToCart') when the Meta Pixel is loaded:
| Event | When |
|---|---|
impro_hotspot_click |
A shape is clicked. |
impro_lookbook_click |
A product list item is clicked. |
impro_add_to_cart |
A product is added to the cart from a card. |
Parameters include the project ID, shape ID, label and product ID. Calls are no-ops when no tag is present. Switches: Module settings → Marketing & analytics.
Files
| Purpose | Path |
|---|---|
| Hook template | views/templates/hook/render.tpl |
| Front controller template | views/templates/front/render.tpl |
| Front script and styles | views/js/front/impro.js, views/css/front/impro.css |
| Back office | views/templates/admin/configure.tpl, views/js/admin/editor.js, views/css/admin/editor.css |
| Uploaded images | uploads/ |
| Storefront translations | translations/<locale>/ModulesImproShop.*.xlf |
Database
| Table | Contents |
|---|---|
ps_impro_project |
One row per project and shop: slug, image and size, shapes and settings (shapes_json), canvas options, enabled flag. |
ps_impro_project_lang |
Project name per language and shop. |
ps_impro_project_scene |
Extra scenes of a project: position, image, size, shapes_json. The project's own image is the first scene. |
ps_impro_project_scene_lang |
Scene names per language. |
ps_impro_analytics |
Clicks and add-to-cart events with shape, scene, event type and anonymous click coordinates. |
Every query is filtered by the current shop; slugs are unique per shop. Upgrade scripts in upgrade/ add new columns automatically.
Uploads and security
- Allowed types: JPG/JPEG, PNG, WebP. The extension, the MIME type (
finfo) and the image structure are all checked. - Maximum size: 10 MB by default, set with the
IMPRO_MAX_IMAGE_SIZEconfiguration value, in bytes. - Files get random names in
uploads/, which is protected against script execution and directory listing. - Every back-office AJAX action requires a valid employee token.
Still stuck?
Customers get support through the PrestaShop Addons contact form, so every request is tracked.
Missing a feature or have an idea? Tell us what you need
Last updated October 8, 2026