Adding a Fixed Handling Fee to a WooCommerce Order

WooCommerce being the most popular free e-commerce plugin allows you to customize your platform easily. Using WooCommerce extensive hooks and filters, you will be able to change this plugin’s default settings without changing its core files. Sometimes you may want to charge your customer with an additional order processing fee, but this option isn’t available in WooCommerce plugin.

However, by default, WooCommerce provides an action hook (woocommerce_cart_calculate_fees) which allows you to fulfill requirements according to your need or will. In this article, you will learn how to add a fixed handling fee to a WooCommerce order.

For this, you need to add pt_add_handling_fee function in your currently activated Theme‘s functions.php file or custom add-on/extension. Run the following code using add_fee method:

In the above listed function, you can change the amount of handling $fee and $title according to your will. After that, every placed order will get an additional charge of $10.00 over the total amount of WooCommerce order.

User Comments

4 thoughts on “Adding a Fixed Handling Fee to a WooCommerce Order

    Laura P says:

    Thank you for sharing this! For stores that have the woocommerce subscriptions extension enabled, it appears to also add the fixed handling fee to subsequent subscription charges. Is there a way to prevent that so that there’s only a one time handling fee ever?

      Hello Laura,

      Do you want to fix the handling fee against each order? If yes then this code snippet will work for you and just fix the fee in the code. If you want any other thing then you have to contact any developer or programmer regarding your custom requirements.

      Thanks for reaching us out. Let us know if you need any other assistance from us.


      Abdullah | WP Plugin Developer

    Brad says:

    Do you know if there is a way to implement this in a way that it does not apply to say a “in store pickup” option?

    Ali says:

    Thank you for this precious piece of code, it’s working fine. But I have a query, am managing reports at backend and, so where this handling fee will be shown in reports.


Leave a Reply

Your email address will not be published. Required fields are marked *

    Get in Touch