# dfreparability — Repairability and durability index for PrestaShop

> The dfreparability module covers the French repairability index (AGEC law, 29 December 2020 decree) and the durability index (22 April 2022 decree) for the 11 mandated product categories, on PrestaShop…

- Page: <https://www.datafirefly.com/en/documentation/dfreparability/>
- Language: en
- Last updated: 2026-07-02
- Other languages: [fr](https://www.datafirefly.com/documentation/dfreparability/index.md), [es](https://www.datafirefly.com/es/documentation/dfreparability/index.md), [de](https://www.datafirefly.com/de/documentation/dfreparability/index.md), [it](https://www.datafirefly.com/it/documentation/dfreparability/index.md), [pl](https://www.datafirefly.com/pl/documentation/dfreparability/index.md), [nl](https://www.datafirefly.com/nl/documentation/dfreparability/index.md), [pt](https://www.datafirefly.com/pt/documentation/dfreparability/index.md)
- Index: <https://www.datafirefly.com/en/documentation/llms.txt>

The **dfreparability** module covers the French repairability index (AGEC law, 29 December 2020 decree) and the durability index (22 April 2022 decree) for the 11 mandated product categories, on PrestaShop 8 and 9.

## Legal framework

Two texts structure the requirement:

- **Repairability index** — mandatory since 1 January 2021 for 9 initial categories, gradually extended (AGEC law of February 2020, decree of 29 December 2020).
- **Durability index** — introduced by the decree of 22 April 2022. Replaces the repairability index for televisions since April 2024 and for front-load washing machines since April 2025.

Both indices are computed on a 0–10 scale from the 5 Bercy criteria (each scored on 20 sub-points). The durability index adds 3 supplementary criteria (reliability, upgradability, maintenance).

**Penalty** — non-display exposes a legal entity to up to €15,000 fine per non-compliant product (Article L541-9-2 of the French Environment Code).

## Installation

1. In the PrestaShop back-office, go to _Modules → Module Manager_, click _Upload a module_ and drop the `dfreparability.zip` file.
2. Click _Install_. The module:
   - creates the `ps_dfreparability_product` table to store per-product scores;
   - creates a CMS page _Repairability and durability index_ with a ready-to-customize reference content;
   - registers the 11 preconfigured categories with the matching Bercy criteria.
3. At install time, the module does _not_ modify any existing product. You enter the scores product by product.

## Entering the index on a product page

dfreparability adds a _Repairability / durability index_ panel to the product page, available in both legacy and Symfony mode (PrestaShop 9). The procedure is the same in both modes.

### The 4 steps

1. **Index type** — choose _Repairability_ or _Durability_. For televisions and front-load washing machines, choose _Durability_ directly (new requirement).
2. **Category** — pick from the 11 preconfigured categories. The criteria grid adapts automatically.
3. **Per-criterion scores** — each scored on 20. The 5 Bercy criteria are always shown. If _Durability_ is selected, the 3 supplementary criteria appear as well.
4. **Final score** — computed automatically from the criteria. A _Manual score_ field lets you override the value if you're applying a specific Bercy adjustment documented in the manufacturer's official grid.

**Optional field — Grid PDF**: fill in the URL to the manufacturer's official detailed grid PDF. It's shown on the product's detailed score page.

## Score computation (0–10)

The module applies the official Bercy method:

```
score_out_of_10 = (sum of scores / number of criteria) / 2
```

Example for a smartphone on the repairability index with these 5 scores:

- Documentation: 16 / 20
- Disassemblability: 14 / 20
- Parts availability: 12 / 20
- Parts price: 10 / 20
- Product-specific: 18 / 20

Score: (16 + 14 + 12 + 10 + 18) / 5 / 2 = 14 / 2 = **7.0 out of 10** — light green band.

### The 5 regulatory bands

The logo color is derived from the score and strictly follows the official thresholds:

| Score | Band | Color code |
| --- | --- | --- |
| ≥ 8.0 | Dark green | `#2d8c3c` |
| 7.0 to 7.9 | Light green | `#79c142` |
| 5.0 to 6.9 | Yellow | `#f5d70a` |
| 3.0 to 4.9 | Orange | `#f08017` |
| < 3.0 | Red | `#cf2127` |

## The 11 preconfigured categories

1. Smartphones
2. Laptops
3. Televisions _(durability since April 2024)_
4. Front-load washing machines _(durability since April 2025)_
5. Top-load washing machines
6. Dishwashers
7. Corded vacuum cleaners
8. Cordless vacuum cleaners
9. Robot vacuum cleaners
10. High-pressure cleaners
11. Electric lawnmowers

For each category, the module ships the criteria grid matching the official texts. If Bercy publishes an update to the criteria, a module update is shipped as part of your license.

## Frontend display

### Position choice

From the module configuration (_Modules → dfreparability → Configure_), three positions are offered on the product page:

- **Under the price** (recommended) — uses the `displayProductPriceBlock` hook with `type=after_price`. Visible immediately on the product page.
- **In an additional-info tab** — uses `displayProductAdditionalInfo`. Places the index under a dedicated tab.
- **Under the thumbnails** — uses `displayAfterProductThumbs`. Recommended if your theme puts the product info to the right of the thumbnails.

Only one position should be active at a time to avoid duplicates. The module enforces this on the configuration side.

### Compact display in listings

A separate option enables a compact badge on product listings (category, search, results pages) via the `displayProductListReviews` hook. The badge shows the colored logo and the score without the per-criterion breakdown.

### Detailed score page

Every product with a defined index has a public page at `/module/dfreparability/detail?id_product={id}` displaying:

- the large-format colored logo;
- the score with the corresponding color band;
- the full criteria grid with per-criterion scores;
- the link to the official PDF if provided;
- a link to the legal information CMS page.

## Legal information CMS page

At install time, the module creates a CMS page _Repairability and durability index_ with reference content in French covering:

- legal grounds (AGEC law, 2020 decree, 2022 decree);
- the 5 color bands table with their thresholds;
- the 11 mandated categories and their effective dates;
- the 5 Bercy criteria and their weighting;
- the supplementary criteria for the durability index.

You're free to edit this page from _Design → Pages_ and to translate it in any of your active languages. Links from the product pages automatically point to the version matching the visitor's browsing language.

## Customization

### Replacing the logos with the official Bercy assets

The module ships 10 SVG logos (2 indices × 5 bands) inspired by the official visual. If the manufacturer provided the official PNG or SVG files, replace them in `views/img/logos/`, keeping the same filenames:

```
reparability-dark-green.svg
reparability-light-green.svg
reparability-yellow.svg
reparability-orange.svg
reparability-red.svg
durability-dark-green.svg
durability-light-green.svg
durability-yellow.svg
durability-orange.svg
durability-red.svg
```

### Adjusting the CSS

The frontend uses the CSS classes `.dfrep-badge`, `.dfrep-score`, `.dfrep-band-*`. The main stylesheet is at `views/css/dfreparability.css`. To override without modifying the module, add your rules in your child theme's CSS — the selectors remain stable across versions.

## Multi-language and multi-store

Included translations: French, English, Spanish, German. Additional languages can be added through PrestaShop's standard translation tool (_International → Translations_).

Product scores are stored by `id_product`, so they're shared between stores in a multi-store network. If a product needs different scores per store, declinate the product. The legal information CMS page can be differentiated per store through PrestaShop's standard tool.

## Product duplication

The module listens on the `actionProductAdd` hook: when you duplicate a product with an index defined, the scores and the criteria grid are automatically copied to the new product.

## Compatibility and prerequisites

- **PrestaShop**: 8.0 to 9.x (both product page modes, legacy and Symfony).
- **PHP**: 7.4 minimum, 8.1+ recommended.
- **Themes**: compatible with Classic, Hummingbird and third-party themes that fire the standard product page hooks.
- **PrestaShop 1.7**: not supported.

## Troubleshooting

### The badge appears twice on the product page

Check that you haven't enabled multiple display positions simultaneously in the module configuration. Since v1.0.1, the `displayProductPriceBlock` hook only responds to the `after_price` type, which prevents internal duplication of the price block.

### The detail page returns "Controller not found"

On PrestaShop 9, clear the Symfony cache (_Advanced parameters → Performance → Clear cache_) after installation. Version 1.0.1 fixes the front controller class name casing to match the canonical form expected by the PS 9 Dispatcher.

### The panel doesn't show up on the Symfony product page

Check that the `actionProductFormBuilderModifier` hook is properly attached to the module (_Design → Positions_). It's the native Symfony hook — if another module has disabled it globally, re-enable it on dfreparability.

## Version history

### 1.0.1 — 14 May 2026

- Fixed the double badge display in the price block (`displayProductPriceBlock` restricted to `after_price`).
- Fixed the front controller class name to the canonical form expected by PrestaShop 9.
- Defensive loading of `dfreparability.php` and `classes/DfReparabilityProduct.php` at the top of the front controller.
- Switched the Smarty variable from `$link` to `$module_dir` in the admin template (PS 9 ExtraModulesType context does not inject `$link`).

### 1.0.0 — 14 May 2026

- First public release.
- Repairability and durability indices per product.
- 11 preconfigured categories, 5 regulatory bands, 10 SVG logos.
- Detailed score page, legal information CMS page.
- FR, EN, ES, DE translations. Compatible with PrestaShop 8 and 9.
