Skip to content
Checkout & Cart Extensions

Extra Fee & Surcharge for Magento 2 Checkout

Add extra fees to the Magento 2 cart and checkout with rules by payment method, customer group, country, subtotal, quantity, products, categories and dates, or a simple small order fee. Each fee is stored with the order and shows in invoices, credit memos and emails.

  • Free
  • Themes listed: Hyvä + Luma
Free $0.00, in stock
Check requirementsSee the versions and themes listed for this package. Details Ask about setupInclude the package name and your Magento and PHP versions. Ask
$0.00
In stock
SKU
panth-extra-fee
Links
composer require mage2kishan/module-extra-fee
SKU
panth-extra-fee
  • Package requirementsRead the source documentation
  • Developer profileView Upwork profile
  • Themes listedHyvä + Luma
  • PHP versions listed8.1, 8.2, 8.3, 8.4
  • Installation questionsDiscuss your store setup

What it does for your store

The main features, as listed in the module documentation.

  • Fee rules

    Any number of rules with sort order and a Stop Further Rules flag. Conditions: store view, website, customer group, payment method, country, subtotal, quantity, products, categories and dates.

  • Four fee types

    Fixed Amount, Percentage of Subtotal, Fixed + Percentage and Percentage with Fixed Minimum, applied per order, per product or per quantity, with minimum and maximum caps.

  • Fee lines on totals and documents

    Cart totals on Hyvä and Luma, the Luma checkout summary, customer order pages, invoices, credit memos, PDFs, emails and the admin order pages.

  • Order Fees grid

    An admin grid of every fee charged per order with invoiced and refunded amounts and CSV export, plus an Extra Fee column in Items Ordered.

Installation

Example commands from the Magento root. Follow the package instructions and your staging and deployment process.

  1. 1Check the releaseMatch Magento, PHP, theme and dependency requirements.
  2. 2Install on stagingReview Composer changes and follow the package instructions.
  3. 3Configure and verifyUse the documented settings and test the affected features.
magento-root
$ composer require mage2kishan/module-extra-fee
$ bin/magento setup:upgrade
$ bin/magento setup:di:compile
$ bin/magento setup:static-content:deploy -f
$ bin/magento cache:clean

Listed requirements

These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.

Magento versions listed2.4.6, 2.4.7, 2.4.8
PHP versions listed8.1, 8.2, 8.3, 8.4
Themes listedHyvä, Luma
Composer packagemage2kishan/module-extra-fee

Read package requirements and license

Documentation

Product details and setup guidance. Check the package repository for release-specific instructions.

Rule based extra fees for the Magento 2 checkout

Extra Fee (Panth_ExtraFee) adds fees and surcharges to the Magento 2 cart and checkout, for example a cash on delivery fee, a handling fee for small orders or a surcharge for some countries or customer groups. Each fee is a separate total that is stored with the order and carried into invoices and credit memos.

What it adds

  • Fee rules managed in an admin grid, with Active, Sort Order and Stop Further Rules. Empty conditions mean no restriction.
  • Conditions: store views, websites, customer groups, payment methods, countries (shipping or billing address), minimum and maximum subtotal, minimum and maximum quantity, specific products, categories and a date range in the store's timezone.
  • Fee types Fixed Amount, Percentage of Subtotal, Fixed + Percentage and Percentage with Fixed Minimum. The fixed part can apply per order, per product line or per unit.
  • Per rule minimum and maximum fee, and a store wide Maximum Total Fee Per Order that scales all fees down.
  • A Small Order Fee in Stores > Configuration that needs no rule.
  • Fee lines as separate rows or one combined row, shown excluding tax, including tax or both.
  • An Order Fees grid with invoiced and refunded amounts and CSV export, an Extra Fee column in the admin Items Ordered table and an optional Extra Fees column in the Sales > Orders grid.
  • A sample data command, bin/magento panth:extrafee:install-sample-data, that creates eight example rules.

Settings

Stores > Configuration > Panth Extensions > Extra Fee, at default, website and store view scope. Rules are under Extra Fee > Fee Rules.

Things to know before installing

  • Tax on fees is calculated and stored for every fee, but it is only added to the order tax and grand total when you set Charge Tax On Fees to Yes. The default is No.
  • Fees cannot be negative, so the module cannot be used for discounts.
  • A rule with payment methods applies only after the customer has chosen a payment method.
  • Credit memos refund fees from rules marked Is Refundable and the small order fee.
  • Fees are skipped for orders created in the admin unless you enable Apply Fees to Admin Orders.
  • With multishipping, the fees apply once, to the first address that has items.
  • On Hyvä the fee rows are added to the cart totals. The checkout summary component is the Luma Knockout one.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.4 to 2.4.8.
  • PHP 8.1, 8.2, 8.3 or 8.4.
  • Panth Core (mage2kishan/module-core), installed by Composer.

Free and open source under the MIT License.

Developer notes

  • PHP namespace: Panth\ExtraFee.
  • Totals: code panth_extra_fee in etc/sales.xml, sort order 460 in the quote section and 450 in order_invoice and order_creditmemo. Quote total segments are named panth_extra_fee_<rule_id>, with panth_extra_fee_0 for the small order fee.
  • Rules from code: Api\FeeRuleRepositoryInterface (save, getById, getList, delete, deleteById) and Api\Data\FeeRuleInterface. The regions and product_skus columns are evaluated by the condition checker but have no form field, so set them through the repository.
  • Calculation: Model\Calculator\FeeCalculator (calculateFees, calculateAmount, calculateSmallOrderFee, calculateTax) and Model\Calculator\ConditionChecker (isRuleValid).
  • Order and document observers: Observer\SaveOrderFees on sales_model_service_quote_submit_success and checkout_submit_all_after, Observer\RegisterInvoiceFees on sales_order_invoice_register, Observer\RegisterCreditmemoFees on sales_order_creditmemo_refund, and Observer\MarkMultishippingOrder on checkout_type_multishipping_create_orders_single (frontend).
  • Admin route front name: panth_extrafee. ACL resources: Panth_ExtraFee::config, Panth_ExtraFee::extra_fee, Panth_ExtraFee::manage_rules and Panth_ExtraFee::view_order_fees.
  • Tables: panth_extra_fee_rule, panth_extra_fee_quote and panth_extra_fee_order.
  • Columns on sales_invoice and sales_creditmemo: panth_extra_fee_amount, panth_base_extra_fee_amount, panth_extra_fee_tax, panth_base_extra_fee_tax and panth_extra_fee_details (JSON fee lines).
  • Logging: messages prefixed Panth_ExtraFee: go to the standard Magento log files through Psr\Log\LoggerInterface. The file var/log/panth_extra_fee.log is configured in etc/di.xml but is not written in this version.
More information
Module Category Cart & Checkout
Best For All Sizes
Kishan Savaliya

Questions before you install?

Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.

Ask on WhatsApp