PHPackages                             joseph-leedy/module-custom-fees - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. joseph-leedy/module-custom-fees

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

joseph-leedy/module-custom-fees
===============================

Adds configurable custom fees to orders

1.3.2(5mo ago)345625[12 issues](https://github.com/JosephLeedy/magento2-module-custom-fees/issues)OSL-3.0PHPPHP ^8.1CI passing

Since Feb 5Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/JosephLeedy/magento2-module-custom-fees)[ Packagist](https://packagist.org/packages/joseph-leedy/module-custom-fees)[ GitHub Sponsors](https://github.com/JosephLeedy)[ RSS](/packages/joseph-leedy-module-custom-fees/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (29)Versions (17)Used By (0)

 [![Latest Stable Version](https://camo.githubusercontent.com/7f68f141e1e6419b60ee7acaf0b0e3df4d804ad6a1c6287647e53c89d7ab6155/687474703a2f2f706f7365722e707567782e6f72672f6a6f736570682d6c656564792f6d6f64756c652d637573746f6d2d666565732f76)](https://packagist.org/packages/joseph-leedy/module-custom-fees) [![Integration Test Status](https://camo.githubusercontent.com/418a03e9132d4dafbcfb6740b7593d1b9b04d9956d62785c2987b2bd44970dba/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4a6f736570684c656564792f6d6167656e746f322d6d6f64756c652d637573746f6d2d666565732f72756e2d696e746567726174696f6e2d74657374732e796d6c3f6c6162656c3d696e746567726174696f6e2532307465737473)](https://github.com/JosephLeedy/magento2-module-custom-fees/actions/workflows/run-integration-tests.yml) [![PHP Version Required](https://camo.githubusercontent.com/168d555e4d11288f855fb3080dbdab4c26e0735f7f4ec2fa8ff7aaf81edced4f/687474703a2f2f706f7365722e707567782e6f72672f6a6f736570682d6c656564792f6d6f64756c652d637573746f6d2d666565732f726571756972652f706870)](https://packagist.org/packages/joseph-leedy/module-custom-fees) [![Magento Version Required](https://camo.githubusercontent.com/e5aa1c9f056b4801604c7abf9dba92d58d837545e728bb681e9d43483ca656d3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d6167656e746f2d322e342e342532422d463436463235)](https://packagist.org/packages/joseph-leedy/module-custom-fees) [![Hyvä Compatibility](https://camo.githubusercontent.com/285d5a9a0ee71dc782cd3991495a040efecd6c9cbff5f9424db82601c90b4651/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f687976c3a42d636f6d70617469626c652d304132334239)](https://packagist.org/packages/joseph-leedy/module-custom-fees) [![Total Downloads](https://camo.githubusercontent.com/7de7b9131954cc7c7d01ed41fcee6aa96f987c1f9e4b52f507be263715140c36/687474703a2f2f706f7365722e707567782e6f72672f6a6f736570682d6c656564792f6d6f64756c652d637573746f6d2d666565732f646f776e6c6f616473)](https://packagist.org/packages/joseph-leedy/module-custom-fees) [![GitHub Sponsors](https://camo.githubusercontent.com/cd5b767a1f9b01f6fb87f3526207a4008ab0fba94b54e58d54d56b479bc7f9cc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f4a6f736570684c65656479)](https://github.com/sponsors/JosephLeedy)

Custom Fees for Magento 2
=========================

[](#custom-fees-for-magento-2)

*by Joseph Leedy*

Custom Fees allows merchants to configure additional fees to be charged to customers when orders are placed.

Features
--------

[](#features)

- Allows fees to be configured with a label and amount to be added to an order
    - Custom fees configuration can be imported via a CSV spreadsheet
    - Conditions can be defined to determine whether a custom fee should be applied to an order based on product and cart details, including specific product attributes, product SKU, cart subtotal, cart item count, total cart weight and more
    - Custom fees can be applied as a fixed amount or a percentage of the order subtotal
- Custom fees are displayed for orders, invoices and credit memos in both the frontend and backend
- Custom fees can be refunded via Magento's credit memo functionality
- Includes a report detailing all charged custom fees for a given time period
- Fully compatible with the [Hyvä](https://hyva.io) theme (Hyvä Default, Hyvä CSP, Hyvä Checkout and Hyvä Checkout CSP)

Requirements
------------

[](#requirements)

- PHP 8.1 or greater
- Magento Open Source 2.4.4 or greater, Adobe Commerce 2.4.4 or greater, *or*Mage-OS 1.0 or greater\*
- MySQL 8.0.4 or greater, MariaDB 10.6.0 or greater, *or* a MySQL 8-compatible database server (for generating reports)

**Note:** Mage-OS compatibility has not been tested, but it is functionally equivalent to Magento Open Source 2.4.6 or greater.

Installation
------------

[](#installation)

This extension can be installed via [Composer](https://getcomposer.org) from [Packagist](https://packagist.org) by running these commands from a terminal on a Web server or in the desired installation location:

```
cd /path/to/your/store
composer require joseph-leedy/module-custom-fees
php bin/magento module:enable JosephLeedy_CustomFees
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

```

Updating
--------

[](#updating)

This extension can be updated via [Composer](https://getcomposer.org) from [Packagist](https://packagist.org) by running these commands from a terminal on a Web server or in the desired installation location:

```
cd /path/to/your/store
composer update joseph-leedy/module-custom-fees
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

Custom Fees can be added from the Magento Admin panel by going to `Stores >  Settings > Configuration > Sales > Sales > Custom Order Fees`. The overall display order of the Custom Fees block in relation to other totals shown in the cart and checkout can be configured at `Stores > Settings > Configuration >  Sales > Sales > Checkout Totals Sort Order`. All settings for this extension can be configured in the Global (Default), Website or Store scope.

#### Importing Custom Fees

[](#importing-custom-fees)

The Custom Fees configuration page allows fees to imported from a CSV spreadsheet containing the following columns:

ColumnDescriptionExamplecodeA unique code identifying the custom fee (allowed characters: "A-Z", "a-z", "0-9", "\_")example\_feetitleA short label describing the custom fee"Example Fee"typeThe type of custom fee ("fixed" or "percent" \[of order subtotal\])"fixed"statusWhether the custom fee is enabled or diasbled ("0", "disabled", "1", "enabled")"enabled"show\_percentage*Optional* - Whether or not to show the percentage next to the fee name ("0", "n", "no", "1", "y", "yes")"yes"valueThe amount of the custom fee, in the store's default currency5.00##### Example CSV Import Spreadsheet

[](#example-csv-import-spreadsheet)

```
code,title,type,status,show_percentage,value
example_fee,"Example Fee",fixed,enabled,0,5.00
```

#### Configuring Adavanced Settings

[](#configuring-adavanced-settings)

Additional settings for a Custom Fee, including Conditions, can be found in the Advanced Settings dialog by clicking on the cog icon "⚙️."

### Reporting

[](#reporting)

To view a report of the collected custom order fees, go to `Reports > Sales >  Custom Order Fees` in the Magento Admin panel.

**Note:** For performance reasons, the report generation process makes use of special database functions that are only available in MySQL 8.0.4+ or MariaDB 10.6.0+. Errors or unexpected behavior may occur when using incompatible database server software versions.

Support
-------

[](#support)

If you experience any issues or errors while using this extension, please [open an issue](https://github.com/JosephLeedy/magento2-module-custom-fees/issues/new) in the GitHub [repository](https://github.com/JosephLeedy/magento2-module-custom-fees). Be sure to include all relevant information, including a description of the issue or error, what you were doing when it occurred, what versions of Magento Open Source or Adobe Commerce and PHP are installed and any other pertinent details. I will do my best to respond to your request in a timely manner.

License
-------

[](#license)

The source code contained in this extension is licensed under the Open Software License version 3.0 (OSL-3.0) license. A copy of this license can be found in the [LICENSE](./LICENSE) file included with the source code or online at .

Copyright for the included source code is exclusively held by Joseph Leedy, all rights reserved.

History
-------

[](#history)

A full history of the extension can be found in the [CHANGELOG.md](./CHANGELOG.md) file.

Contributing
------------

[](#contributing)

We welcome and value your contribution. For more details on how you can help us improve and maintain this tool, please see the [CONTRIBUTING.md](./CONTRIBUTING.md) file.

Shout-Outs
----------

[](#shout-outs)

### Contributors

[](#contributors)

These wonderful people have helped this extension become what it is today, and I am truly grateful to them for their contributions:

- A huge thanks to [@pykettk](https://github.com/pykettk), [@Vinai](https://github.com/Vinai) and [@hostep](https://github.com/hostep) for reviewing the Hyvä compatibility implementation in [pull request #16](https://github.com/JosephLeedy/magento2-module-custom-fees/pull/16) and suggesting improvements!️

### Supporters

[](#supporters)

I owe the following fine folks a debt of gratitude for their continuing support:

- [@paulcdejean](https://github.com/paulcdejean)

###  Health Score

45

—

FairBetter than 92% of packages

Maintenance75

Regular maintenance activity

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Recently: every ~19 days

Total

13

Last Release

166d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d8c74cbdad96d6e82dff81532a5c2f5aa2440ab57d102de9d6ee770fb49f001?d=identicon)[JosephLeedy](/maintainers/JosephLeedy)

---

Top Contributors

[![JosephLeedy](https://avatars.githubusercontent.com/u/3091468?v=4)](https://github.com/JosephLeedy "JosephLeedy (608 commits)")

---

Tags

adobe-commercefeefeeshyvamage-osmagento2magento2-extensionsurchargesurchargestarifftariffsmagentomagento 2adobe commercehyvamage-osfeessurcharges

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/joseph-leedy-module-custom-fees/health.svg)

```
[![Health](https://phpackages.com/badges/joseph-leedy-module-custom-fees/health.svg)](https://phpackages.com/packages/joseph-leedy-module-custom-fees)
```

###  Alternatives

[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[yireo/magento2-googletagmanager2

Add Google Tag Manager to Magento

167930.4k5](/packages/yireo-magento2-googletagmanager2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69344.4k](/packages/run-as-root-magento2-prometheus-exporter)[pagbank/payment-magento

PagBank - Payment for Magento and Adobe

2128.3k7](/packages/pagbank-payment-magento)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
