Extra Fee
v1.1.5
Extra Fee
- Mises à jour et support inclus pendant 12 mois
- Clé de licence livrée immédiatement par email
- Garantie satisfait ou remboursé 30 jours
- Documentation complète incluse
- Installation prête pour Composer
Extra Fee
Ajoutez les surcharges que votre logistique terrain impose — sans les enfouir dans le prix produit ou le prix de port. Wimakeit Extra Fee vous laisse définir des frais supplémentaires pilotés par des règles, qui apparaissent comme une ligne de totals dédiée sur le panier, le checkout summary, la commande, la facture et l'avoir. Chaque règle qui match produit une ligne distincte clairement labellisée, pour que le client voie toujours ce qu'il paie et pourquoi.
Conçu pour les marchands dont le pricing dépend du conditionnement et de la manutention, le module couvre trois cas concrets dès l'install : un montant fixe quand le subtotal panier reste sous un seuil, une caution / dépôt facturée par palette ou big bag, et un frais connexe fixe déclenché par une option produit. Les règles se gèrent depuis un admin grid dédié — pas besoin de dev pour ajouter, éditer ou désactiver une règle.
À qui ça s'adresse
- Marchands B2B et industriels qui livrent en palettes ou en vrac, où cautions et frais de manutention font partie du pricing standard
- Sites qui veulent une surcharge si commande minimum non atteinte, sans bloquer la commande
- Marchands qui ont besoin que les frais remontent proprement à travers quote, order, invoice et credit memo pour la compta
Bénéfices clés
- Piloté par règles, une ligne par règle — définissez autant de règles que nécessaire ; chaque match ajoute sa propre ligne labellisée sur le panier, le checkout, la commande, la facture, l'avoir.
- 3 types de frais en standard — frais fixe quand subtotal panier sous un seuil, caution par palette ou big bag, et frais connexe fixe sur option produit
wmi_fraisconnexes. - Gestion par admin grid — créer, éditer, activer, désactiver, mass-update les règles depuis un grid dédié. Le form edit est hardened : CSRF form-key, whitelist mass-assignment au save, XSS-escape dans le delete confirm.
- Scope par store view et customer group — chaque règle peut être limitée à des store views et/ou customer groups via multiselects ; laisser vide (ou choisir la sentinelle "All …") = applique partout. Adossé à des junction tables normalisées (
wimakeit_extrafee_rule_store,wimakeit_extrafee_rule_customer_group) avec filtres EXISTS / NOT EXISTS sargables au runtime. - Tax-aware — choisissez si les frais sont taxables et quelle tax class s'applique, les totaux restent corrects par store view.
- Pilotage par attributs produit — les règles caution et connexe lisent des attributs
wmi_*dédiés (auto-provisionnés à l'install). - Cycle de commande propre — les frais persistent à la place order et remontent dans les factures, avoirs, PDFs et emails de commande. Le breakdown persisté résiste au tampering : les montants négatifs sont rejetés avant stockage.
- Magento 2.4 / Mage-OS natif — service contract Api (
Wimakeit\ExtraFee\Api\RuleRepositoryInterface), enum PHP 8.1 backedRuleType, declarative schema avec colonnes whitelistées. AucunMagento\Framework\Registrylegacy.
Compatibilité
- Magento 2.4.x / Mage-OS équivalent
- PHP 8.1, 8.2, 8.3, 8.4
- Fonctionne avec le checkout Luma standard ; pour Hyvä, ajouter le companion
wimakeit/module-extra-fee-hyva - Le menu admin se range sous le menu Wimakeit fourni par
wimakeit/module-core
Installez ce module via Composer. Assurez-vous que votre auth.json est configuré avec vos identifiants Wimakeit.
$ composer require wimakeit/module-extra-fee:^1.1.5
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
Installation notes
The standard composer require + setup:upgrade + setup:di:compile flow applies. The points below cover what's specific to this module.
composer require wimakeit/module-extra-fee
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
Requires PHP 8.1+ (tested up to 8.4) and Magento 2.4.x / Mage-OS equivalent.
Companion modules
- For a Hyvä storefront, install
wimakeit/module-extra-fee-hyva, which renders one fee row per rule in the cart, checkout summary, and mini-cart. The Luma checkout is supported out of the box. - The admin menu attaches under the Wimakeit parent menu provided by
wimakeit/module-core.
ACL resources
After installation, two new ACL resources are available under System → Permissions → User Roles, grouped under Wimakeit Extra Fee:
| Resource | Default |
|---|---|
Wimakeit_ExtraFee::rule (manage fee rules in the admin grid) | granted to Administrator role only |
Wimakeit_ExtraFee::config (edit module configuration) | granted to Administrator role only |
Assign them to your back-office roles as needed.
Configuration
The module ships with safe defaults. Go to Stores → Configuration → Wimakeit → Extra Fees only if you want to change them. All settings are available per store view.
General settings
| Setting | Default |
|---|---|
| Enable Module | Yes |
| Apply Tax on Fees | Yes |
| Fee Tax Class | Taxable Goods (tax class ID 2) |
Fee Tax Class is only shown when Apply Tax on Fees is set to Yes.
Fee rules
Fees themselves are managed as rules under Wimakeit → Extra Fees → Manage Rules. Three rule types are available:
- Fixed fee when cart subtotal is below a threshold — a flat surcharge applied while the subtotal stays under the configured amount.
- Caution / deposit (palette, big bag…) — a deposit computed from the
wmi_cautionandwmi_quantite_paletteproduct attributes. - Fixed fee per item matching a
wmi_fraisconnexesoption — a connex fee triggered by a product option.
Each matching rule adds its own labelled totals line. No rules exist after install — create the ones you need.
Each rule carries two scoping multiselects since 1.1.0:
- Store Views — select "All Store Views" (sentinel value
0) to apply everywhere, or pick specific stores. Empty selection is treated as "all" on save. - Customer Groups — select "All Customer Groups" (sentinel
32000=GroupManagement::CUST_GROUP_ALL) to apply to every group, or pick specific groups.
Product attributes (provisioned automatically)
A data patch creates three product attributes used by the caution and connex rules. The patch is idempotent: any attribute that already exists is left untouched.
| Attribute | Type | Purpose |
|---|---|---|
wmi_caution | select | Caution type (palette A, big bag, …) |
wmi_quantite_palette | decimal | Quantity packed per caution unit |
wmi_fraisconnexes | select | Connex-fee option triggering a fixed fee |
All three are scope=global and created with is_filterable=0 to avoid breaking category pages via OpenSearch. They appear on products under a dedicated Wimakeit Extra Fees attribute group.
Storage layout
| Table | Purpose |
|---|---|
wimakeit_extrafee_rule | Rule configuration rows (label, type, JSON params, priority) |
wimakeit_extrafee_rule_store (since 1.1.0) | Rule × Store View scope. Empty junction = applies to every store |
wimakeit_extrafee_rule_customer_group (since 1.1.0) | Rule × Customer Group scope. Empty junction = applies to every group |
wimakeit_extrafee_sales_fee | Per-order snapshot of every fee line applied at submit |
quote / quote_address | Aggregate fee + tax columns (wimakeit_extrafee_*) for total-collector math |
sales_order / sales_order_address / sales_invoice / sales_creditmemo | Same aggregate columns for downstream lifecycle |
The legacy CSV columns wimakeit_extrafee_rule.store_ids and customer_group_ids are kept for rollback and will be dropped in a future release.
1.0.x → 1.1.0+ migration
Existing rules with CSV scope columns are migrated to the new junction tables by a data patch (MigrateRuleStoreAndGroupCsvToJunction) at setup:upgrade time. The patch is idempotent and transactional: it skips rules that already have junction rows and rolls back on error. Sentinel semantics are preserved — store_ids containing 0 and customer_group_ids containing 32000 produce empty junctions (= "applies to all"), which is the same semantics the runtime applied before.
To verify after the upgrade:
-- Each rule should be present with either matching junction rows
-- or an empty junction (= applies to all).
SELECT r.rule_id, r.label, r.store_ids AS legacy_csv,
COALESCE(GROUP_CONCAT(rs.store_id ORDER BY rs.store_id), '— (all stores)') AS junction
FROM wimakeit_extrafee_rule r
LEFT JOIN wimakeit_extrafee_rule_store rs ON rs.rule_id = r.rule_id
GROUP BY r.rule_id, r.label, r.store_ids
ORDER BY r.rule_id;
Totals position
The fee totals line is positioned between subtotal and tax by default (sort order 25). Override under Stores → Configuration → Sales → Sales → Checkout Totals Sort Order.
REST extension attributes
Two extension attributes are exposed on Magento\Quote\Api\Data\TotalSegmentInterface and Magento\Sales\Api\Data\OrderInterface via DI preferences (since 1.0.1):
wimakeit_extrafee_lines— per-rule fee breakdown attached to the totals API segmentwimakeit_extrafee_sales_fees— per-order frozen breakdown attached to the Sales API responses
This makes the per-line detail consumable by REST / GraphQL clients (Hyvä checkout, custom front-ends, BI exports) without any extra plumbing.
- Version
- v1.1.5
- Support
- 12 mois
- Dernière mise à jour
- 25 août 2026
- Magento
- Magento 2.4.4 Magento 2.4.5 Magento 2.4.6 Magento 2.4.7 Mage-OS 2.0 Mage-OS 2.1
- PHP
- PHP 8.1 PHP 8.2 PHP 8.3
- Hyvä
- Non compatible
- Package
-
wimakeit/module-extra-fee
Vérifier la compatibilité
Indiquez votre stack pour vérifier la compatibilité du module.
Categories: Security, Feature, Fix, Perf, Admin, Deps.
[1.1.5] - 2026-06-08
Fix
- Cart / checkout no longer throws
Unknown column 'wimakeit_extrafee_rule.rule_id'. The rule-collection'sEXISTS/NOT EXISTSsubqueries (store and customer-group filters) now reference themain_tablealias, matching how MySQL/MariaDB resolves the outer FROM clause. Affected every page that hits the totals collector.
[1.1.4] - 2026-06-05
Admin
- Internal cleanup of the admin rule grid signature for consistency with the rest of the Wimakeit family. No functional change.
[1.1.3] - 2026-06-05
Admin
- Marketing documentation now ships inside the release tag so the marketplace listing reflects the current feature set.
[1.1.2] - 2026-06-05
Fix
- Editing a fee rule that applied to "All Store Views" or "All Customer Groups" no longer silently wipes the scope on save. The sentinel values now pre-select correctly when re-opening the rule.
[1.1.1] - 2026-06-05
Admin
- New dedicated multiselect sources for Store Views and Customer Groups that expose the "All …" sentinel options so admins can pick and pre-see them in the form.
[1.1.0] - 2026-06-05
Perf
- Rule scope is now stored in dedicated junction tables (
wimakeit_extrafee_rule_store,_customer_group) and queried via sargable EXISTS / NOT EXISTS instead of the legacyFIND_IN_SETCSV scan — the per-collectTotalsrule lookup no longer ignores the index.
Admin
- Existing rules are migrated automatically at
setup:upgradetime (idempotent, transactional). "Applies to all stores" and "Applies to all customer groups" sentinels are preserved.
[1.0.3] - 2026-06-05
Admin
- Internal class names for the Caution and FraisFixe calculators and their dropdown sources anglicised (Deposit, FixedFeePerItem) so the codebase reads consistently. Database values, product attribute codes and rule behaviour are unchanged.
[1.0.2] - 2026-06-05
Admin
- Module exposes a proper Service Contract (
Api\RuleRepositoryInterface) so other Wimakeit and partner modules can extend the rule layer cleanly. TheRuleTypeis now a PHP 8.1 backed enum with full back-compat.
[1.0.1] - 2026-06-05
Security
- Admin Delete Rule button escapes the URL and confirm message — closes an XSS vector through admin-controlled parameters in the inline delete confirm.
- Delete controller explicitly validates the form key on every POST — closes a CSRF surface on the grid's inline delete action.
- Save controller whitelists allowed POST fields — closes a mass-assignment surface where extra keys could land on the model.
- Fee line amounts are clamped to non-negative both at the value-object boundary and again before persistence — protects against tampering of the persisted breakdown JSON between cart and order place.
Fix
- Admin order creation and REST / CLI contexts no longer fail with a session error when the cart totals plugin runs outside the storefront session.
- REST extension attributes for the fee breakdown now serialise correctly thanks to the new DI preferences on the data interfaces.
Perf
- Active-rules lookup is request-scoped cached, eliminating the repeated DB hit on every
collectTotalscall during checkout. - Fee-line persistence on order placement switched from a per-row loop to a single multi-insert.
Admin
- Dropped the deprecated
\\Magento\\Framework\\Registryfrom every Rule controller; the form data flows through theDataProvideronly.
Deps
- All
magento/constraints pinned to versioned ranges (was). PHP range widened to<8.5to certify PHP 8.4 support.
[1.0.0] - 2026-06-03
Feature
- Initial public release. Rule-driven extra fees with three rule types: fixed surcharge below a subtotal threshold, deposit per palette / big bag (caution), and fixed connex fee per matching cart item. Admin grid + form for managing rules (create / edit / enable / disable / mass actions). Tax-aware, scope-aware (store view × customer group). The per-rule breakdown is frozen on order place and surfaces on invoice, credit memo, PDFs and order emails.
Vous avez trouvé un bug ? Faites-nous-en part.
Un court formulaire s'ouvre dans un nouvel onglet — le nom du module et votre langue sont déjà pré-remplis. Décrivez ce que vous avez tenté, ce qui n'a pas fonctionné, et nous vous répondrons sous un jour ouvré.
Signaler un bug pour Extra FeeBesoin d'aide ?
Notre équipe est disponible pour vous accompagner dans l'intégration.