Hello Magento Friends,

Today we will discuss Magento 2: How to Bind Custom Text while Add Comment in Admin Sales Order View.

Customization is the central part of Magento 2. Store admin can customize anything as per the business requirement. Customizing the admin sales order view helps the admin to efficiently fulfill orders leading to improved user experience.

If you want to add custom text while adding comment in the admin sales order view in Magento 2, you can use the below steps.

Steps to Bind Custom Text while Add Comment in Admin Sales Order View in Magento 2:

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

app\code\Vendor\Extension\etc\adminhtml\

And then add the code as follows

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

app\code\Vendor\Extension\Plugin\Adminhtml\Order

Then add the below code snippet

Output:

custom text

Conclusion:

Implementing the above steps correctly, you can Bind Custom Text while Add Comment in Admin Sales Order View in Magento 2. Also, add custom button in the admin sales order view page. Share the tutorial with your friends and stay connected with us!

Happy Coding!

Click to rate this post!
[Total: 1 Average: 5]