Extra Fee

v1.1.5 Updated Aug 25, 2026

Extra Fee

Rule-driven surcharges that appear as their own totals line on the cart, checkout, order, invoice and credit memo, one clearly labelled line per rule.
Magento 2.4.4 Magento 2.4.5 Magento 2.4.6 Magento 2.4.7 Mage-OS 2.0 Mage-OS 2.1
€99.00
Try the live demo
  • Updates and support included for 12 months
  • License key delivered immediately by email
  • 30-day money-back guarantee
  • Full documentation included
  • Composer-ready installation

Extra Fee

Add the surcharges your real-world logistics demand — without hard-coding them into shipping or product prices. Wimakeit Extra Fee lets you define rule-driven extra fees that appear as their own totals line on the cart, checkout summary, order, invoice, and credit memo. Each matching rule produces exactly one clearly-labelled fee line, so customers always see what they are paying for and why.

Built for merchants whose pricing depends on how goods are packed and handled, it covers three concrete cases out of the box: a fixed fee when the cart subtotal stays below a threshold, a deposit / caution charged per palette or big bag, and a fixed connex fee triggered by a product option. Rules are managed from a dedicated admin grid — no developer needed to add, edit, or disable a fee.

Who it's for

  • B2B and industrial merchants shipping palletised or bulk goods where deposits and handling fees are part of normal pricing
  • Stores that want a minimum-order surcharge instead of a hard order block
  • Merchants who need fees to flow correctly through quote, order, invoice, and credit memo for clean accounting

Key benefits

  • Rule-driven, one line per rule — define as many rules as you need; each matching rule adds its own labelled totals line on cart, checkout, order, invoice, and credit memo.
  • Three fee types built in — fixed fee when the cart subtotal is below a threshold, deposit per palette or big bag, and fixed connex fee driven by a wmi_fraisconnexes product option.
  • Admin grid management — create, edit, enable, disable, and mass-update rules from a dedicated grid. The edit form is hardened: form-key CSRF check, mass-assignment whitelist on save, XSS-escaped delete confirm.
  • Store-view and customer-group scoping — each rule can be restricted to specific store views and customer groups via multiselects; leave empty (or pick the "All …" sentinel) to apply everywhere. Backed by normalised junction tables (wimakeit_extrafee_rule_store, wimakeit_extrafee_rule_customer_group) with sargable EXISTS / NOT EXISTS filters at runtime.
  • Tax-aware — choose whether fees are taxed and which tax class applies, so totals stay accurate per store view.
  • Product-attribute driven — deposit and connex rules read dedicated wmi_* product attributes (auto-provisioned at install).
  • Clean order lifecycle — fees persist on order placement and carry through to invoices, credit memos, PDFs, and order emails. The persisted breakdown is tamper-resistant: negative amounts are rejected before storage.
  • Magento 2.4 / Mage-OS native — service-contract Api (Wimakeit\ExtraFee\Api\RuleRepositoryInterface), PHP 8.1 backed RuleType enum, declarative schema with whitelisted columns. No legacy Magento\Framework\Registry.

Compatibility

  • Magento 2.4.x / Mage-OS equivalent
  • PHP 8.1, 8.2, 8.3, 8.4
  • Works with the standard Luma checkout; for Hyvä, add the companion wimakeit/module-extra-fee-hyva
  • Admin menu lives under the Wimakeit menu provided by wimakeit/module-core

Install this module via Composer. Make sure your auth.json is configured with your Wimakeit credentials.

Terminal
$ 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:

ResourceDefault
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

SettingDefault
Enable ModuleYes
Apply Tax on FeesYes
Fee Tax ClassTaxable 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_caution and wmi_quantite_palette product attributes.
  • Fixed fee per item matching a wmi_fraisconnexes option — 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.

AttributeTypePurpose
wmi_cautionselectCaution type (palette A, big bag, …)
wmi_quantite_palettedecimalQuantity packed per caution unit
wmi_fraisconnexesselectConnex-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

TablePurpose
wimakeit_extrafee_ruleRule 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_feePer-order snapshot of every fee line applied at submit
quote / quote_addressAggregate fee + tax columns (wimakeit_extrafee_*) for total-collector math
sales_order / sales_order_address / sales_invoice / sales_creditmemoSame 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 segment
  • wimakeit_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 months
Last updated
Aug 25, 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ä
Not compatible
Package
wimakeit/module-extra-fee

Compatibility checker

Pick your stack to see if this module fits.

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's EXISTS / NOT EXISTS subqueries (store and customer-group filters) now reference the main_table alias, 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 legacy FIND_IN_SET CSV scan — the per-collectTotals rule lookup no longer ignores the index.

Admin

  • Existing rules are migrated automatically at setup:upgrade time (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. The RuleType is 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 collectTotals call 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\\Registry from every Rule controller; the form data flows through the DataProvider only.

Deps

  • All magento/ constraints pinned to versioned ranges (was ). PHP range widened to <8.5 to 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.

Found a bug? Tell us about it.

A short form opens in a new tab — the module name and your language are already filled in. Share what you tried, what went wrong, and we will get back to you within one business day.

Report a bug for Extra Fee
Module SKU: wimakeit-module-extra-fee · Language: en_US

Need help?

Our team is available to assist with integration.

Contact us
Planifier un appel