Developer notes
Data model (prefix ?:kv_epr_)
Section titled “Data model (prefix ?:kv_epr_)”| Table | Content |
|---|---|
streams |
Stream code (packaging, weee, batteries, textiles, furniture, custom_*), name (custom streams), position, status |
rules |
Country x stream: status, required, format mode + regular expression, example, register name + URL, lookup (none, ademe, lucid), show on product / invoice, note, seed flag |
category_streams |
Category -> stream (applies to subcategories) |
product_streams |
Product override per stream (A = add, X = exclude) |
product_packaging |
Product x material x layer (sales, grouped, transport) -> grams per unit |
product_info |
Info-tri text (the image is an image pair of object type kv_epr_infotri) |
shipment_packaging |
Company x material -> grams per order |
registrations |
Company x country x stream (unique): number, holder, status, format flag, register check (status, source, name, detail, time), valid until, self-certification (name, time), notes, decision |
files |
Evidence files (private custom_files storage, AES-256-GCM when available) |
log |
Audit log |
alerts |
Admin notifications (dedupe key) |
reports |
Declaration history (scope, period, totals, SHA-256 of the CSV) |
Company id: on Multi-Vendor the vendor (0 = the marketplace itself); on CS-Cart / Ultimate the storefront company.
Register checks
Section titled “Register checks”ADEME open data (France). GET https://data.ademe.fr/data-fair/api/v1/datasets/rep-producteurs-idu/lines?Identifiant_unique_eq=<UIN>&select=Identifiant_unique,Filiere,Raison_Sociale,Pays&size=5 (data set “REP - Liste des producteurs enregistrés dans SYDEREP avec leur identifiant unique”, data.gouv.fr dataset 6419b09847c2a0503b3fa6a4, Licence Ouverte 2.0). Response {"total": n, "results": [{"Identifiant_unique", "Filiere", "Raison_Sociale", "Pays"}]}. The scheme (Filiere) is compared with the stream: packaging EMPAP or EPRO (professional packaging, scheme code 02), WEEE EEE, batteries BAT, textiles TLC, furniture EA. The scheme codes and the UIN shape (FR + 6 digits + _ + 2-digit scheme code + 4 characters, e.g. 01 = EMPAP, 05 = EEE) were read from the data set itself (2026-11-24); ADEME does not publish a format specification, so the format rule is editable. Tests use captured responses (tests/fixtures/ademe_*.json). Override the base URL for a mock with $config['kv_epr_ademe_url'].
LUCID register excerpt (Germany). ZSVR documents “XML file structure - Register excerpt” v1.1 (15 July 2026) and “API Documentation - Register excerpt” v1.0: GET https://registerabruf.verpackungsregister.org/v1/listofproducers?token=<token>; 200, 401 (token missing), 403 (invalid token or format), 429 (rate limit; X-RateLimit-Limit/Remaining/Reset), 500, 503. XML (UTF-8 with BOM): Root > VersionNoInterface, DateOfCreation, ListOfProducers > Producer > ProducerName, RegistrationNumber, Country, TypeOfTaxNumber, TaxNumber, PackagingDetailCode (10/20/30), WithAuthorisedRepresentative (yes/no). Only producers with an active registration are listed. The file is streamed with XMLReader (LIBXML_NONET, no external entities) and stored privately as var/custom_files/kv_epr_packaging/lucid/excerpt.xml. The fixture tests/fixtures/lucid_excerpt_example.xml is the example of the ZSVR PDF. Mock base URL: $config['kv_epr_lucid_url'].
Core hooks
Section titled “Core hooks”| Hook | Use |
|---|---|
calculate_cart_post |
$cart['kv_epr_blocked'] (blocked lines for the ship-to country) |
pre_place_order |
refuses the order on the storefront (also Storefront API and mobile app); warning only in the admin panel |
update_product_pre, tools_update_status_before_query |
publish gate (vendors) |
update_product_post |
saves the product tab (product_data[kv_epr]) and the Info-tri image |
get_products |
hide mode (storefront, Multi-Vendor) |
get_product_data_post |
product page data (products.view only) |
update_category_post, delete_category_after |
category streams |
clone_product, delete_product_post, delete_company |
copy / clean up |
Template hooks: products:tabs_content and categories:detailed_content (admin); products:product_detail_bottom, products:product_additional_info (cart line), checkout:final_section_customer_notes, companies:top_links (storefront).
Document variable
Section titled “Document variable”schemas/documents/order.post.php adds kv_epr to order documents: {{ kv_epr.numbers }} (string) and kv_epr.lines (label, number, country, stream). Order documents render Twig with autoescape off, so every value is HTML-escaped in EprVariable; numbers are also limited to letters, digits, space and / . _ - when saved.
Full page cache and security
Section titled “Full page cache and security”- Storefront output depends only on the product or the vendor (numbers, Info-tri, “cannot ship to”), never on the visitor or the session. The per-visitor parts (cart warnings, checkout refusal) are on cart and checkout pages, which are never cached.
- Hide mode by known country uses the session of signed-in customers only; guests get the same lists. In that mode the block cache key contains the customer’s country, so a cached product list is never shown to a customer of another country.
- Evidence files live in the private
custom_filesstorage, under random names, encrypted with AES-256-GCM (key derived from the store’s crypt key) when the server supports it; content is checked against the extension (PDF magic bytes, real images). They are served only by the add-on controllers after a permission check: administrators with “View EPR registry”, vendors only their own company. - Vendor controller: every query is scoped by
runtime.company_id;company_idin the request is ignored; administrator pages (kv_epr) are closed to vendors invendor_multivendor.post.php. - CSV cells starting with
= + - @are prefixed with'.
Scheduled work
Section titled “Scheduled work”Admin panel views run the light part at most once an hour (expiry after the grace period, “ending soon” notifications, clearing old read notifications). The console cron php admin.php --dispatch=kv_epr.cron runs the same plus, if enabled, the LUCID excerpt download (at most every 20 hours). Vendor panel views never run it. Outbound calls use HTTPS only (cURL protocols restricted; plain HTTP only for a local mock URL). Coverage also treats an accepted registration whose end date is past the grace period as not covering, before the expiry job runs.
Upgrades
Section titled “Upgrades”Every release ships Upgrade\Synchronizer: after an upload over the installed add-on, the next admin page view adds missing tables, columns, settings and language variables. Uninstall keeps the data tables (see retention.json in the source) unless the purge setting is on.