Hello Magento Friends,

In today’s blog, we will learn how to display custom fee in summary on the admin order view page in Magento 2.

Magento 2 is a highly customizable platform that allows developers to modify almost every aspect of its functionality. One common requirement is to display custom fees or charges in the order summary on the Admin Order View page. This can be useful for adding special handling fees, additional service charges, or any other custom costs associated with an order.

In this blog post, we’ll walk through the steps to add a custom fee and display it in the summary section of the Admin Order View page in Magento 2.

Steps to Display a Custom Amount in the Admin Order View Order Summary in Magento 2:

Step 1: First, we need to create a “sales_order_view.xml” file inside our extension at the following path

app/code/Vendor/Extension/view/adminhtml/layout/sales_order_view.xml

Then add the code as follows

Step 2: After that, we need to create a “Customfee.php” file inside our extension at the following path

app/code/Vendor/Extension/Block/Adminhtml/Sales/Customfee.php

And include the code as given below

Output:

custom fee

Conclusion:

By following the steps outlined in this blog post, you can successfully add and display a custom fee in the Admin Order View Order Summary in Magento 2. This customization can help provide a better administrative experience and allow you to include additional charges directly within the order details.

Hire a Magento Developer to further customize the admin sales order view of your Magento 2 store for the smooth functioning of the admin panel.

Happy Coding!

Click to rate this post!
[Total: 0 Average: 0]