Skip to main content

Extra Fee

Overview​

Magento currently only supports certain shipping methods: Free Shipping, Flat Rate, Table Rate, UPS, Magento Shipping, USPS, FedEx, and DHL. If store owners want to add fees for any services in their store, such as gift wrap, fast shipment within 2 hours, etc., they can not be configured. Developed by Mageplaza, Magento 2 Extra Fee module allows shoppers to add whatever fees they want and display them on their Checkout and Shopping Cart pages.

Outstanding features​

Outstanding featuresDescription
1Automate the process of calculating and managing fees

Total Fees Integration: Calculate all fees, including discounts, shipping, and taxes, clearly displayed on Order Grid & Product Pages to ensure transparency.

With seamless Checkout Integration and accurate Invoice and Credit Memo Calculation, you will deliver a transparent checkout experience.

Product-Specific Fees: Allows for detailed analysis of each product, and Fee Calculation Conditions enable flexible fee application based on order value or other rules.

Fee Calculation Conditions:: Provide percentage-based calculations, minimum order totals, and other conditions for additional fees to optimize fee application to suit different customer business rules and scenarios.

Advanced Reporting: Include reporting features for additional charges. Equip store owners with tools to analyze charge data, track trends, and make informed decisions.

2Enhance customer experience

Frontend Descriptions: Provide detailed descriptions of additional fees right on the user interface, helping customers clearly understand the fees applied, reducing confusion and increasing trust.

Multi-Address Checkout: Support payments for multiple addresses, ensuring the accuracy of charges for each destination.

Customizable Display Options: You can customize where and how additional charges are displayed according to your store's needs.

Email Customization: Allow email customization to include fee details, keeping customers fully and accurately informed.

Customer Interaction: Customer interaction is also improved through Customer Interaction, which offers more customization and communication options regarding additional charges.

Installation​

We offer two methods for installing our plugins: the Copy & Paste method and the Composer method. Please follow the detailed instructions provided below.

Method 1: Installation via Copy & Paste​

To install our plugins using the Copy & Paste method, kindly follow the instructions at the link below:

How to Install Magento 2 Extension via Copy & Paste

Method 2: Installation via Composer​

Composer name: mageplaza/module-extra-fee

To install our extensions using Composer, please refer to the comprehensive guide at the link below:

How to Install Magento Extension via Composer

By following these guides, you can ensure that the installation process is handled correctly, allowing you to fully utilize the features and benefits of our plugins.

Module Update Guide​

Keeping your module updated ensures optimal performance. Follow one of these steps to update your module:

  1. By Account Dashboard: Log in to your Mageplaza account > go to the My Licenses section > click on the Download button > choose the latest version from the popup.
  2. By composer: Kindly use the following commands to update the module via composer
composer require mageplaza/mageplaza/module-extra-fee
php bin/magento setup:upgrade
php bin/magento setup:di:compile

Updating a module by Composer ensures efficient dependency management, version control, and integration with development tools, making the process faster and more reliable.

How to configure​

From the Admin Panel, go to Stores > Extra Fee > Configuration

1. Configuration​

From the Admin Panel, go to Stores > Extra Fee > Configuration, choose General sections

  • Enable: Select Yes to use the feature of the module

  • Calculate Total includes: Choose how to calculate the service cost

    • Calculate Total includes = Discount: the service fee includes the discount
    • Calculate Total includes = Shipping Fee: The service fee is calculated after shipping surcharge
    • Calculate Total includes = Tax: The service fee includes the tax of the product
    • Many options can be selected
    • Only apply this calculation method with the fee type as a percentage
  • Show Extra Fee on the Order Grid: If Yes, the extra fee information will be displayed in the order grid.

  • Display Extra Fees on Product Page: Select Yes to display the product's extra fee information on the product page.

    • Title: Enter the title of all extra fees on the product page.

    • Display Extra Fees on Product Page: Select the display position for all extra fees on the product page. There are 2 positions:

      • Before Add to Cart button:

      • After Add to Cart button:

    • Available Days for The Rules: Select the days of the week to apply the rule. The user can select one or more values.

    Note: At least one value is required.

2. Manage Extra Fees​

This feature helps simplify the administration of extra fees, allowing for easy adjustments and consistent application across the store.

From the admin > Mageplaza > Extra Fee > Manage Rules > choose General

How to Add New Rule​

  • Step 1: Enter the full information in the General section
  • Step 2: Set the conditions to apply the rule in the Condition section
  • Step 3: Set the form, service fee, display area ... of the rule in the Action section
  • Step 4: Enter the rule's title for display in both frontend and backend view
Step 1: Enter the full information in the General section​
  • Name: Enter the name of the rule
  • Status: Select "Enable" to apply the rule
  • Description: Enter the information to describe the extra fee

  • Store Views

    • Only selected stores have applied the rule
    • Multiple stores can be selected at the same time
  • Customer Groups

    • Only selected customer groups can see the rule
    • Multiple groups can be selected at the same time
  • Allow Customer Notes/Messages of Extra Fee: If yes, it will display the message section with each extra fee on the frontend so that the customer can leave a note or message. This only applies to the Manual Type.

  • Message Title: Enter the message title

  • From Date: Choose the date

  • To Date: Choose the date

  • Available Days: Select the days of the week to which the rule applies.

    • Display all days of the week from Monday to Sunday
  • The default value is to select all days of the week

  • Allow multiple values, but the user must select at least 1 value

Note: The Available Days field is a condition that has no relationship with the 2 conditions [From Date] and [To Date]. These 3 fields combine values ​​together to get a value file that is the days the rule applies. For example: The rule application period is from 01/03/2024 to 15/07/2024 on Monday, Tuesday, Thursday, etc.

  • Priority Β  - Enter the priority for applying the rule
    • The smaller the number, the higher the priority. For rules with equal priority, the priority will be based on ID.

Step 2: Set the conditions to apply the rule in the Condition section​
  • Select conditions to apply the rule
  • You can set the conditions for the Cart or Product, Customer and Other…. sections as Subtotal greater than 50, Total Items Quantity less than 5, Quantity In Stock, conditions based on customer information, etc.

Step 3: Set the form, service fee, and display area ... of the rule in Action section​
  • Apply Type:

  • Apply Type: Automatic

If you choose Apply for the Whole Cart, there are three fee types:

  • Fee Type = Percentage of cart total: Service fee will be calculated as a percentage of the total cart
  • Fee Type = Fixed amount for the whole cart: Service fee will be charged as a certain amount when the customers purchase the products
  • Fee Type = Fixed amount for each item: The service fee will be calculated as a certain amount on each item in the cart

If you choose Apply for each product in cart, there are two fee types:

Note: Choosing Apply for each product in cart means only products that meet the conditions below will be calculated for the rule.

  • Fee Type = Percentage of cart total: Service fee will be calculated as a percentage of the total cart

  • Fee Type = Fixed amount for each item: fixed value for products

  • Fee Type = Percentage of each item: calculate extra fee according to % of each product

  • Apply Type: Manual

  • Apply Type = Manual: Customers can optionally choose the service type of the rule
    • Display Area: Choose the area to show the rule

  • Display Area = Cart Summary: Display the rule in the Cart Summary section

  • Display Area = Shipping Method: Display the rule in the Shipping Method section

  • Display Area = Payment Method: Display the rule in the Payment Method section

  • Display Type: Choose the display type of the rule for customers to choose

  • Display Type = Radio: Allow choosing the display type as radio

  • Display type= Select: Allow choosing the display type as select

  • Display Type = Checkbox: Allow choosing the display type as checkbox

  • Is Required: Choose Yes to force customers to choose at least one service type.

  • Apply Type = Automatic: Service type of the rule will be applied automatically.

  • Fee Amount

    • Enter the amount or percentage (depending on the payment type you choose) to apply for the service fee
    • This field is not allowed to be empty
  • Fee Tax:

    • Choose Tax Rule to calculate the fee tax for service fee
    • Fee Tax = No: Not apply to calculate the fee tax for service fee
  • Cart Sort Order:

    • Enter the priority for displaying the rule on the frontend and in the admin order
    • The smaller the input number, the higher the display priority. For the rule with equal priority, the priority will be based on the ID.
  • Refundable:

    • Choose Yes to apply the service fee for the refund order
    • The service fee will be applied at the first refund
  • Stop further processing:

    • Choose Yes to limit the number of rules that are applied for the service types (based on the priority and ID)
    • For example, There are 4 rules: Rule 1, Rule 2, Rule 3, and Rule 4, and the respective priority is 0, 5, 3, and 3.
      • All rules are set as Stop further processing = No: all rules are applied
      • Edit Rule 3 and choose Stop further processing = Yes: After you Apply Ryle, the applied rules are Rule 1 (as the high priority) and Rule 3. Rule 2 (as the small priority) and Rule 4 (as creating later) are not applied.
  • Calculate Total includes: Choose how to calculate the service cost

    • Calculate Total includes = Discount: the service fee includes the discount
    • Calculate Total includes = Shipping Fee: The service fee is calculated after shipping surcharge
    • Calculate Total includes = Tax: The service fee includes the tax of the product
    • Many options can be selected
    • Only apply this calculation method with the fee type as a percentage
  • Manage Option

    • Type: Choose the service fee type
      • Fee Type = Percentage of cart total: Service fee will be calculated as the percentage of total cart
      • Fee Type = Fixed amount for the whole cart: Service fee will be charged as a certain amount when the customers purchase the products
      • Fee Type = Fixed amount for each item: The service fee will be calculated as a certain amount on each item in the cart
    • Amount: Enter the amount or percentage (depending on the payment type you choose) to apply for the service fee
    • Admin:
      • Enter the display name in the admin order/invoice/shipment/credit memo for the selected service type
      • This field is not allowed to be empty
    • Stores: Enter the display name for added service type on the frontend of the stores
    • Is Default: Choose the default service type when customers choose a new service
    • New Option: Click on the New Option button to setup other services
Step 4: Enter the rule's title for display in both frontend and backend view​
  • Manage titles: Enter the display name of the rule’s title.

Frontend​

1. Display on the Cart Summary​

This section provides customers with a clear view of all extra fees before proceeding to checkout, ensuring transparency and avoiding surprises.

2. Display on the Payment Method​

Ensure customers are aware of any additional fees associated with different payment options at the point of payment selection.

3. Display on the Shipping Methods​

Allow customers to see how different shipping options impact the total cost, promoting informed decision-making

4. Display on the Order​

Confirm all extra fees are clearly outlined for the customer on their final order summary, reinforcing transparency.

5. Display on the Invoice​

Ensure that all extra fees are accurately reflected in the invoice for record-keeping and customer reference.

6. Display on the Shipment​

Provide comprehensive fee information in shipment notifications or details, ensuring customers are aware of all costs associated with their orders.

7 Display on the Credit Memo​

Maintain consistency in financial documentation by including extra fees in credit memos, reflecting any adjustments or returns accurately.

8 Display on the Checkout with Multiple Addresses​

Ensure all extra fees are accurately applied and displayed for each shipping address in multi-address checkouts, providing a clear and complete cost overview.

The extra fee is applied when checking out with multiple addresses in the following positions:

  • Shipping Method:

  • Payment Method:

  • Cart Summary:

Backend​

1. Order​

2. Invoice​

3. Shipment​

4. Credit Memo​

5. Order Grid​

Show the extra fee information in the order grid. Go to Sales > Orders to learn more about this information.

Email​

1. Order Email​

2. Invoice Email​

3. Shipment Email​

4. Credit Memo Email​

Compatible with Mageplaza One Step Checkout​

Compatible with Mageplaza PDF Invoice​

1. PDF Order​

2. PDF Invoice​

3. PDF Shipment​

4. PDF Credit Memo​

Compatible with PDF of Magento​

1. PDF Invoice​

2. PDF Shipment​

3. PDF Credit Memo​

How to customize using the layout handle​

  • To display Extra Fee in Magento's default email, you need to visit Marketing > Communications > Email Templates. You can create a new template for order, invoice, shipment, credit memo, etc. Use different code for each template to display Extra Fee data (do the same for PDF Invoice templates). Note: If there is extra fee data, this data will be displayed and vice versa, if there is no data, this template will be the same as normal Magento template.
    • Order, Shipment
      • Get Extra Fee information at Payment Method.
{{if order.getHasBillingExtraFee()}}
{{layout handle="mp_billing_extra_fee" order_id=$order_id area="frontend"}}
{{/if}}

  • Get Extra Fee information at Shipping Method.
{{if order.getHasBillingExtraFee()}}
{{layout handle="mp_billing_extra_fee" order_id=$order_id area="frontend"}}
{{/if}}

  • Get Extra Fee information at Cart Summary. Note: The rules with Apply Type = Automatic will also appear in Cart Summary in the backend and display on the template.
{{if order.getHasExtraFee()}}
<h3>{{trans "Extra Fee"}}</h3>
{{layout handle="mp_extra_fee" order_id=$order_id area="frontend"}}
{{/if}}

  • Invoice
    • Get Extra Fee information at Payment Method:
{{if invoice.getHasBillingExtraFee()}}
{{layout handle="mp_billing_extra_fee" order_id=$order_id area="frontend" invoice_id=$invoice_id}}
{{/if}}

  • Get Extra Fee information at Shipping Method
{{if invoice.getHasShippingExtraFee()}}
{{layout handle="mp_shipping_extra_fee" order_id=$order_id area="frontend" invoice_id=$invoice_id}}
{{/if}}

  • Get Extra Fee information at Cart Summary. Note: The rules with Apply Type = Automatic will also appear in Cart Summary in the backend and display on the template.
{{if invoice.getHasExtraFee()}}
<h3>{{trans "Extra Fee"}}</h3>
{{layout handle="mp_extra_fee" order_id=$order_id area="frontend" invoice_id=$invoice_id}}
{{/if}}

  • Credit Memo:
    • Get Extra Fee information at Payment Method
{{if creditmemo.getHasBillingExtraFee()}}
{{layout handle="mp_billing_extra_fee" order_id=$order_id area="frontend" creditmemo_id=$creditmemo_id}}
{{/if}}

  • Get Extra Fee informaiton at Shipping Method
{{if creditmemo.getHasShippingExtraFee()}}
{{layout handle="mp_shipping_extra_fee" order_id=$order_id area="frontend" creditmemo_id=$creditmemo_id}}
{{/if}}

  • Get Extra Fee information at Cart Summary. Note: The rules with Apply Type = Automatic will also appear in Cart Summary in the backend and display on the template.
{{if creditmemo.getHasExtraFee()}}
<h3>{{trans "Extra Fee"}}</h3>
{{layout handle="mp_extra_fee" order_id=$order_id area="frontend" creditmemo_id=$creditmemo_id}}
{{/if}}

Note:

  • You can view the template of PDF Order when it is compatible with Extra Fee extension here
  • For Invoice and Credit Memo, all fees of Extra Fee will be added to Invoice or Credit Memo first.

API​

Extra Fee extension by Mageplaza supports using Rest API to get extra fee data rules, collect total for customers or guest customers.

Please view details here.

Guide on how to create Integration tokens here.

GraphQL​

Run the following command in Magento 2 root folder:

composer require mageplaza/module-extra-fee

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

Extra Fee extension by Mageplaza supports getting data of Extra Fee rule and extra information in order with positions such as: payment method, shipping address, cart summary.

To start working with Extra Fee GraphQL in Magento, you need to:

  • Use Magento 2.3.x orr 2.4.x. Take the site to the developer mode.
  • Learn more about GraphQL requests we support here

FAQs​

How to add a custom fee in Magento 2?
First of all, you need to install the Extra Fee for the Magento 2 extension and enable it by going to the Admin panel > Mageplaza > Extra Fee > Configuration > choose Yes in the Enable section to turn on the module. Then, go back to Mageplaza > Extra Fee > Manage Rules > click on the Add New Rule button to create a new custom fee. Next, setup conditions for that rule and save configuration.
What kind of services or items can be set as an extra fee?
Anything! You can also set as many fees as possible, as our extension allows users to add unlimited rules. You can apply a fee for services like gift wrapping, express delivery, or special items like big-size, fragile, need insurance, etc.
How to set quick delivery as the top priority?
You can set the priority level for each fee by numbering them. The smaller the number is, the higher priority it has. If you want the quick delivery fees to be the top priority, set it as 0.
Can I set fixed fees with this module, or does it depend on the product amount?
Mageplaza's Extra Fee extension allows users to set the charges for additional services flexibly. There are 3 options available: fixed amount for each item, fixed amount for the whole cart, and percentage of cart total.

Maintenance​

Troubleshooting Articles​

For common issues and their fixes, refer to these articles:

How to configure Extra Fee in Magento 2

Support and Assistance​

1. Customer Support​

For any assistance, please visit our support page or email us at cs@mageplaza.com/ sales@mageplaza.com

2. Create a Ticket​

If you have technical issues, please open a ticket at this link.

3. Operating Hours​

Our support team is available during the following hours:

  • Monday to Friday: 8:00 AM - 23:59 PM
  • Saturday: 8:00 AM - 12:00 PM
  • Sunday: Closed

4. Refund Policy​

We understand that sometimes things don't go as planned. Please review our refund policy for detailed information: Refund Policy Link

5. Frequently Asked Questions (FAQ)​

For common questions, please visit our FAQ page: FAQ Page Link