PS PrestaShop Intermediate

AI Size & Fit Advisor — Complete guide

Install, configure and use the AI size advisor for PrestaShop 8 and 9.

Updated Module version 1.0.0

AI Size & Fit Advisor replaces your static size guide with a real advisor: the shopper enters their measurements on the product page and gets the best-fitting size, with a confidence score, an alternative and a measurement-by-measurement breakdown. This guide covers installation, configuration, creating size charts and how the recommendation engine works.

Installation

  1. Download the dfsizefit.zip archive from your DataFirefly account.
  2. PrestaShop back office → ModulesUpload a module → send the ZIP.
  3. The module creates its tables, registers its hooks and adds the Catalog → Size & Fit Charts tab.

Compatible with PrestaShop 8.0 to 9.x, on PHP 7.2.5+ (PS8) and 8.1+ (PS9). No override, no external dependency.

General configuration

Go to Modules → AI Size & Fit Advisor → Configure.

AI layer

The module works without AI thanks to its deterministic engine. You can enable an optional AI layer to refine the decision based on morphology and generate an explanation in the shopper’s language.

  • Enable AI layer: when off, no external call is made.
  • Provider: Mistral, OpenAI or Anthropic.
  • API key: stored server-side, never exposed to the front office.
  • Model: for example mistral-small-latest, gpt-4o-mini or claude-haiku-4-5.

If the API fails or times out, the module automatically falls back to the deterministic engine. A recommendation is always available.

Fit preference

Enable this option to offer the shopper Snug / Regular / Loose choices. The module applies a ±3% bias to the measurements to steer the size up or down according to the desired fit.

Fit-learning

When enabled, the module anonymously logs profiles and recommendations in a dedicated table, to analyze relevance and spot the references that run small or large.

Unit and display hook

  • Default unit: centimeters or inches.
  • Display hook: displayProductActions (near the add-to-cart button) or displayProductAdditionalInfo (under the product information).
  • Button label: leave empty to use the default translation “Find my size”.

Create a size chart

Open Catalog → Size & Fit Charts → Add.

Scope

Each chart has a scope that determines the products it applies to:

  • Global: applies to all products (reference left at 0).
  • Category: enter the category ID.
  • Product: enter the product ID.

Resolution is cascading: the module first looks for a product-level chart, then its categories, then the global chart. The first match is used.

The grid editor

The visual editor works like a table: one row per size, one column per measurement.

  • Add a measurement column (chest, waist, hips, inseam, foot length, etc.) from the selector, then the “Add column” button.
  • Add a size row with “Add a size” and name it (S, M, L, 38, 40…).
  • For each cell, enter a minimum / maximum range in the configured unit.
  • Pick the gender (women, men, unisex, kids) and activate the chart.

Enter consistent ranges with no gaps between sizes. The more measurements you cover, the more reliable the recommendation.

How the recommendation works

The recommendation runs in several steps:

  1. Deterministic matching: the engine scores every size by comparing the shopper’s measurements against the chart ranges (distance to the center of each range, penalty when out of range), then applies the fit bias.
  2. AI refinement (optional): if the AI layer is active, the provider confirms or adjusts the size accounting for morphology (height, weight) and writes a short explanation.
  3. Fallback: if the AI fails, the deterministic result is kept.

The shopper receives the recommended size, a confidence score, an alternative size and the per-measurement breakdown (in range, snug or loose).

Front-office display

On the product page, a “Find my size” button opens a modal. The shopper enters their measurements, optionally height, weight and fit preference, then submits. The result is shown in the same window, with a confidence bar and the per-measurement breakdown.

Fit-learning and returns analysis

Each recommendation can be logged with its anonymized profile, the engine used and the confidence score. The return status (kept, returned too small, returned too large) helps, over time, to identify problematic cuts and adjust your charts.

Compatibility and technical notes

  • PrestaShop 8.x and 9.x, multistore and multilingual.
  • Legacy admin controller (no Symfony controller) for PS8/PS9 compatibility.
  • Front AJAX endpoint via the module link; JSON rendered by a dedicated method.
  • Shopper data stored on your shop; only the part needed for the calculation is sent to the chosen AI provider.

FAQ and troubleshooting

The button does not appear on the product page. Check that an active chart applies to the product (product, category or global scope) and that the chosen display hook is grafted onto your theme.

The recommendation reports missing data. The shopper did not enter a measurement matching the chart columns. Add common columns (chest, waist, hips) or invite the shopper to fill in more fields.

The AI returns nothing. Check the API key and the model name. The module falls back to the deterministic engine anyway; no recommendation is lost.

Was this page helpful?

Still stuck? Contact support