AI Size & Fit Advisor: complete guide
Install, configure and run the size advisor for PrestaShop 8 and 9: charts, shopper journey, stock, returns and AI.
AI Size & Fit Advisor recommends the right size from the shopper’s height and weight, or from their tape measurements. This guide covers installation, configuration, size charts, the shopper journey, return tracking and the optional AI layer. It documents version 1.2.0.
Installation and upgrade
- Download the module archive from your DataFirefly account.
- PrestaShop back office, Modules, Upload a module: send the ZIP.
- The module creates its tables, registers its hooks and adds the Catalog > Size & Fit Charts tab.
- Clear the cache in Advanced Parameters > Performance.
To upgrade from 1.0, install the new archive over the old one. The upgrade scripts create the new tables, migrate the target of each existing chart and register the new hooks.
Compatible with PrestaShop 8.0 to 9.x, PHP 7.2.5+ (PS8) and 8.1+ (PS9). No override, no external dependency. Translations included: French, English, Spanish, German, Italian, Dutch, Polish, Portuguese.
Configuration
Open Modules > AI Size & Fit Advisor > Configure. The page shows the performance panel, then two blocks of settings.
Performance panel
It sums up the last 30 days: recommendations and shoppers, orders placed after a recommendation, share of orders in the recommended size, return rate in the recommended size and in another size, share of recommendations made from height and weight only, share of AI answers and most advised products.
Size advisor
- Display hook:
displayProductActions(next to the add-to-cart button),displayProductAdditionalInfo, or the custom hookdisplayDfSizeFit, placed anywhere in the product template with{hook h='displayDfSizeFit' product=$product}. - Button label: one label per language. Leave empty to use “Find my size”.
- Button style: outlined, filled or text link. Accent color: used for the button, the recommended size and the active choices.
- Unit of your size charts: centimeters or inches. Shoppers can still switch between cm/kg and in/lb in the advisor.
- Ask fit preference: adds the snug, regular or loose choice.
- Remember the shopper profile: pre-fills the advisor and shows “Your size: M” on the product page at later visits. Stored in the browser, and in the customer account when logged in.
- Show the size chart tab and Button to select the recommended size.
- Store recommendations (statistics): required for the performance panel and return tracking.
AI layer
- Enable AI layer: when off, no external call is made.
- AI provider: Mistral, OpenAI or Anthropic. Model: for example
mistral-small-latest,gpt-4o-miniorclaude-haiku-4-5. - API key: masked field, stored server-side. Leave it empty to keep the saved key.
- AI calls per visitor per hour: beyond it the deterministic engine answers alone. 0 removes the limit.
- Save and test the connection: checks the key and model, and shows the provider’s error if any.
If the AI does not answer, times out or suggests a size missing from the chart, its answer is ignored and the deterministic engine answers. A recommendation is always available.
Creating a size chart
Open Catalog > Size & Fit Charts > Add new.
Start from a template
Six templates fill the grid and the gender: women clothing (bust, waist, hips), men tops (chest, waist), men jeans (waist), EU shoes (foot length), kids by height, hats (head circumference). Then adjust the values to your brand. If your shop works in inches, templates are converted.
Applies to
- All products: default chart.
- Categories: tick one or more categories in the tree.
- Brands: select one or more brands.
- Products: search products by name, reference or ID.
When several charts match a product, the module keeps, in this order: the product chart, the brand chart, the category chart (default category first, then the deepest one), and finally the “All products” chart.
Gender and model fit
- Women or Men: the module estimates measurements for that body type.
- All or Unisex: the shopper picks “Women” or “Men” in the advisor.
- Kids: no body-type estimate. Use a height or weight column.
Model fit tells whether the item is true to size, runs small or runs large. The engine then shifts the recommendation by about 3.5% and the shopper reads “This model runs small: the advice takes it into account”.
The grid
- Add one column per measurement: chest, bust, waist, hips, shoulder width, sleeve length, inseam, neck, thigh, foot length, head circumference, height or weight.
- Add one row per size (S, M, L, 38, 40…) and enter a minimum / maximum range in each cell.
- Enter body measurements, not garment measurements.
A range whose minimum exceeds its maximum is highlighted in red, then swapped when saving. Avoid gaps between two consecutive sizes.
Testing the chart
Below the grid, the Test this chart block runs the real engine on the grid being edited, even before saving. Enter a gender, a height and a weight: you get the recommended size, the confidence score, the neighbouring size and the estimated measurements (marked with an asterisk).
In the chart list, the Duplicate action creates a disabled copy with the same targets, to derive a chart per brand or per fit.
The shopper journey
On the product page, the “Find my size” button opens a window with two tabs, “My size” and “Size chart”. On mobile it opens as a sheet from the bottom of the screen.
Height & weight
Default path. The shopper enters height, weight, build (slender, average or full) and, if the chart is unisex, whether they are shopping for women or men. No tape measurement is needed.
My measurements
The shopper enters tape measurements. A silhouette highlights the current measurement and shows the matching tip. Height and weight stay optional: they fill in the measurements left empty.
The result
The shopper sees the recommended size, the confidence score, the neighbouring size to consider, an explanation and the per-measurement breakdown (good fit, snug or loose, marked “estimated” when the value comes from height and weight). The “Select size M” button picks the matching combination on the product page. The “Size chart” tab shows the grid, recommended size highlighted, in the unit chosen by the shopper.
Remembered profile
On later visits, the product page button shows “Your size: M” straight away. The “Forget my measurements” link clears the profile from the browser and the customer account.
How the size is calculated
- Estimate: without tape values, circumferences (bust, chest, waist, hips, neck, thigh) are estimated with a regression on body mass index per gender, adjusted by build, and lengths are proportional to height.
- Matching: each size gets a score from the distance of the measurements to the center of each range, with a penalty outside the range. The fit preference and the model fit shift the measurements before the comparison.
- Confidence: calculated measurement by measurement, then lowered when values are estimated.
- Neighbouring size: the size just above or just below in the grid, on the side where the shopper’s body sits.
- AI (optional): the provider confirms or adjusts the size and writes the explanation in the shopper’s language.
Stock, orders and returns
With stock management enabled, the module checks the combinations whose name matches the chart sizes. If the recommended size is out of stock in every combination, the shopper sees “Size M is currently out of stock”, the button offers the neighbouring size if it is available, and the product page shows “Your size: M (out of stock)”.
When an order is validated, the shopper’s latest recommendation (30 days) for each product is linked to the order, with the size actually ordered. Merchandise returns requested by the customer and credit slips created in the back office then mark the recommendation as returned. This feeds the return rate of the performance panel.
GDPR and data
- Profiles and recommendations are stored on your shop.
- With the psgdpr module, exporting and deleting a customer’s data includes their profile and recommendations.
- With the AI layer, only the measurements needed for the calculation are sent to the provider, without name or email.
FAQ and troubleshooting
The button does not show on the product page. Check that an active chart applies to the product and that the chosen hook exists in your theme. With displayDfSizeFit, add the hook call to the product template.
The “Select size” button does not show. The attribute value name must match the size name in the chart (for example “M” on both sides).
The advisor asks for more measurements. In “My measurements” mode, at least one measurement matching the chart columns is required. In “Height & weight” mode, height, weight and gender are required.
The return rate stays empty. Enable “Store recommendations”. The rate appears after the first orders linked to a recommendation.
The AI does not answer. Use “Save and test the connection” to read the provider’s error. The deterministic engine answers meanwhile.