Checkout

WooCommerce Fixed Checkout Admin/Handling Fee

WooCommerce additional checkout fee added as order meta

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About This Solution

A little warning, unexpected fees at checkout can put some users off and some payment gateways do not allow custom additional fees. Passing on fees and surcharges may not be legal in your location so do check before implementing this code snippet. Adding a fixed amount fee at checkout for handling or administration costs is really easy and appears in the order summary box as an order item. Once the order is paid for, the admin fee is shown on the order received thank you page, order editor as a line item, and in all of the post-purchase emails where the order table appears.

/*
* Snippet Name:		WooCommerce Add Checkout Admin/Handling Fee
* Snippet Author:	ecommercehints.com
*/

add_action( 'woocommerce_cart_calculate_fees', 'ecommercehints_fixed_checkout_admin_fee', 25 );
function ecommercehints_fixed_checkout_admin_fee() {
		WC()->cart->add_fee( 'Admin Fee', 5 ); // 5 being the fee value
}

Snippet Benefits

  • Add a custom fee at the checkout stage for administration costs or handling.
  • Adding a fee at checkout would be a good way to cover payment gateway fees.

100 WooCommerce Conversion Rate Optimisation Tips

This field is for validation purposes and should be left unchanged.

Let’s collaborate!

Need to outsource WordPress development?

Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.

First Timer Here?

Sign up to receive 10% off on your first month with us.

26027
WELCOME OFFER