Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    How to add custom price/fee in order total magento2

    If you want to add custom price/custom fee in your total, then you can use following approach.

    create sales.xml in you module etc folder


    Now, define app\code\Webkul\Test\Model\Total\Customfee.php, where you update your total according to your custom fee.

    . . .

    Comments (7)

    Add Your Comment

  • Martin Peasley
    What happens when your order fails for some reason and a new quote is created? Does the custom fee get added to the new quote that gets generated?
  • vinit kumar
    HI can you explain why you have used Sales.xml
  • Vinit
    Is above code For extra fee will work with PayPal Express Checkout ?
  • Arsalan Ajmal
    Hi Thanks for your article It works great. Now can you help me about how to set my custom price at cart subtotal in checkout summary? As I want to change cart subtotal on fly after saving shipping rates information.
  • Display custom price fee on checkout cart and summary total in magento2
    […] How to add custom price/fee in order total magento2 […]
  • How to display custom price fee in sales order view page
    […] How to add custom price/fee in order total magento2 […]
  • Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close