Do you want to add custom fees to your WooCommerce store? Then, this tutorial will show you three different methods to add custom fee WooCommerce to maximize your revenue.
If you are running an online store, you may have to charge your customers extra fees during the WooCommerce checkout process. For example, you may have to include shipping and handling fees, payment method fees, and more.
The good news is that WooCommerce offers a lot of flexibility, allowing you to add custom fee to your online store effortlessly.
Before looking at different options for doing so, let’s dig a little deeper and analyze when it makes sense to charge users more.
When Do You Need to Add Extra Fees to your WooCommerce Store?
There are many situations where you may need to add custom fees to your WooCommerce store. Below are some of the most common ones.
Handling Fees
Handling fees are additional charges you include when your products are deemed fragile. These include items that can be damaged easily. So they need to be moved more carefully. They also often need special packaging.
Therefore, if you sell this kind of product, you may have to charge a custom fee on your WooCommerce store to prevent them from being damaged in transit.
Express Delivery
When a person purchases products from an online store, the delivery will take a specific period depending on where the products are delivered and the delivery services the store owner use.
However, sometimes, products may need to be delivered immediately. So some delivery services offer express delivery for a surcharge.
If this is something your customers may be interested in, you can offer it at your WooCommerce store.
Shipping Regions
While online stores can deliver products internationally, shipping fees can vary from country to country or even from state to state within a country.
As a result, you need to charge different shipping fees depending on where the receiver is. For example, if your physical store is in New York, you can offer free shipping to New York citizens, making it a convenient option for customers seeking transportation to New York. However, you charge a small fee for delivery in other US states and a higher fee for other cases.
Payment Gateways
You may also need to add payment gateway fees (or transaction fees) to your WooCommerce store. With the increasing use of online payments, some services demand a commission for each transaction if you use them.
Therefore, you may need to transfer all or part of these costs to your customers depending on the payment methods you accept in your WooCommerce store.
You can get more about WooCommerce payment by reading the article: How to Set Up WooCommerce Apple Pay on Your eCommerce Site?
Taxes
Some online stores include taxes on product prices, but others don’t. If your WooCommerce store is the latter, you need to add taxes during the checkout process.
Moreover, tax rates change between countries and even between states sometimes. So adding tax fees to the checkout process can be a good choice.
How to Add a Custom Fee to Your WooCommerce Store?
There are 3 ways to add additional fees on WooCommerce checkout:
- From WooCommerce
- Via code
- Use a plugin
Each method has its own advantages and disadvantages. Therefore, please read them all and choose one that best suits your needs.
#1: Add Custom Fees from WooCommerce
- Visit WooCommerce > Settings and choose the Shipping tab.
- Then click on the Add shipping zone button.
- Here, you can add a shipping zone by entering its name and region.
- After that, click on the Add shipping method button to add the very first shipping method for this shipping zone.
- Here, there are several choices you can pick. Since we are adding a custom fee, we need to choose the Flat rate option.
- After that, click on the Add shipping method button.
- A shipping method should be added now. Click on the Edit text under it.
- You will be redirected to a new page where you can change its title, tax status, and cost. Just enter what you need.
- Of course, do not forget to click on the Save changes button when you’re done.
Now, you can repeat the process to add more shipping zones and shipping methods for each zone.
Adding a custom fee to your WooCommerce store this way is effortless. However, as you can see, you have limited choices.
So, if you want to be more flexible, you can use one of the two methods below.
#2: Add a Custom Fee to WooCommerce Programmatically
Using code to customize WooCommerce stores is not for everyone. But it gives you much more control.
You will need to add code to the “functions.php” file to do so. To access it, go to Appearance > Theme File Editor from the WordPress dashboard.
You can add many types of extra charges to your WooCommerce store. Here, we will introduce you to some of the most common ones.
Add a Flat Fee
Most of the time, the customs fee you need to add are fixed. Express delivery and handling fees are some common examples.
To add this type of additional price to your WooCommerce store, use the code below and edit it to suit your needs. In our case, we call it “Additional Charge”. And the fee is $10.
add_action('woocommerce_cart_calculate_fees', function() {
if (is_admin() && !defined('DOING_AJAX')) {
return;
}
WC()->cart->add_fee(__('Additional Charge', 'txtdomain'), 10);
});
Add a Percentage-Based Fee
Not all the extra fees are fixed. Some are based on percentages, such as taxes and payment gateway fees.
If you want to add dynamically custom fees to WooCommerce carts, use the code below. In this case, we add a 3% tax to the total price (products + shipping cost).
add_action('woocommerce_cart_calculate_fees', function() {
if (is_admin() && !defined('DOING_AJAX')) {
return;
}
$percentage = 0.03;
$percentage_fee = (WC()->cart->get_cart_contents_total() + WC()->cart->get_shipping_total()) * $percentage;
WC()->cart->add_fee(__('Tax', 'txtdomain'), $percentage_fee);
});
Add a Flat Fee to Certain Products
Another option is to add a flat fee to specific products on your WooCommerce store. For example, if you have products that require special handling, you can add an extra cost for them. In this case, you can use the following code:
In the example above, we add a flat fee of $5 for products with IDs 600, 650, and 700. Just take the code and edit it to suit your needs.
add_action('woocommerce_cart_calculate_fees', 'add_fees_on_ids');
function add_fees_on_ids() {
if (is_admin() && !defined('DOING_AJAX')) {return;}
foreach( WC()->cart->get_cart() as $item_keys => $item ) {
if( in_array( $item['product_id'], fee_ids() )) {
WC()->cart->add_fee(__('Additional Charge'), 5);
}
}
}
function fee_ids() {
return array( 600,650,700 );
}
#3: Add custom fee WooCommerce by using a plugin
The third way to add custom fee to your WooCommerce store is using a plugin. Checkout Fields Manager for WooCommerce is one of the best plugins to add custom fees to your WooCommerce store. It gives you more control and options for including fields than of WooCommerce. For more details, I will share them with you in the next part of this article.
- To use this plugin, you need to install it first. So, navigate to Plugins > Add new from the WordPress dashboard.
- Then search for Checkout Fields Manager for WooCommerce.
- Next, click on the Install Now button, and then Activate the plugin.
- Now, go to WooCommerce > Checkout and open the Checkout tab. You’ll see a few predefined payment fields that you can enable or disable for the checkout process.
In this tutorial, we will teach you how to add fields for custom fees without conditional logic. More specifically, we will add a field for fast delivery that customers can choose.
- Now click on the Add new field button.
- Enter the details somewhat like the screenshot below.
- Once you are done, go to the Options tab to add fields and enter the price you want to charge.
- Lastly, don’t forget to save the changes, or you will lose all of your processes.
Top 5 WooCommerce Plugins to Add Custom Fees
In this article, I will share with you the top 5 best WooCommerce plugins to add custom fees to your store.
Checkout Fields Manager for WooCommerce
- Price: Free
- Rating: 4.4/5 (552 reviews)
The first one in the list of top 5 WooCommerce plugins to add custom fees is Checkout Fields Manager for WooCommerce. This is a plugin built to be a wizard of checkout pages. With it, the checkout process can be modified in an intuitive way.
You can easily customize the existing fields, expands payment information, and creates any extra fields you need on WooCommerce checkout pages.
Flat Rate Shipping Plugin For WooCommerce
- Price: Free
- Rating: 4.1/5 (70 reviews)
The next option is Flat Rate Shipping Plugin For WooCommerce. This is one of the most powerful, easy, and flexible shipping plugins for WooCommerce store owners.
It allows you to add multiple custom flat rate shipping methods to your WooCommerce store based on conditions like country, product, category, quantity, product tag, cart subtotal, and shipping method based on user.
Extra Fees Plugin for WooCommerce
- Price: Free
- Rating: 4.5/5 (31 reviews)
Lying in the third place is the Extra Fees Plugin for WooCommerce. This WooCommerce plugin allows you to set up additional fees based on multiple conditional rules with a simple and easy configuration.
It provides complete control for you to set up rules for custom fees on your WooCommerce store. You can configure them based on product, quantity, country, user, cart subtotal, etc.
WooCommerce Advanced Extra Fees Lite
- Price: Free/ $49
- Rating: 4.2/5 (9 reviews)
The fourth solution is WooCommerce Advanced Extra Fees Lite. If you want a plugin that works consistently and is packed with features that allow you to set up extra fees for the products in your basket, WooCommerce Advanced Extra Fees Lite is the one for you. The plugin is one of the few solutions that allow for the design and management of conditional rules that determine the final value to be paid by the user.
The plugin allows store managers complete control over the fee, allowing them to establish one or more fee regulations. Whether you want to design a rule that keeps the cart value or the cart quantity as an important factor, this plugin allows you to do so. The plugin is available in both free and paid versions. While the free edition offers a great deal of freedom, the premium version allows you to define rules that run for a set period of time.
Payment Gateway Based Fees and Discounts for WooCommerce
- Price: Free / $59
- Rating: 5/5 (42 reviews)
Last but not least, you may take a look at the plugin Payment Gateway Based Fees and Discounts for WooCommerce if you want to add custom fee to your WooCommerce store. Unlike the plugins mentioned above, the Payment Gateway Based Fees and Discounts for WooCommerce plugin is specifically developed for store owners who want to maximize the fee-only payment gateway. This means that if store managers want to add a conditional charge to the checkout with the payment gateway as the deciding element, this is the plugin to use.
Having a plugin with additional functionalities just adds to the confusion. This, on the other hand, is largely concerned with the manner of payment. You may easily set up fees and additional reductions based on the payment method chosen by the user. The rule can be applied globally or at the product level.
Store managers can also define fees based on the country, state, and product category using the Payment Gateway Based Fees and Discounts for WooCommerce Plugin. Premium features include the ability to exclude one or more payment types from fees, specify a fixed or percentage-based fee, and so on.
Final Words on How to Add Custom Fee WooCommerce
In general, adding a custom fee to your WooCommerce store can be helpful in various situations.
But regardless of the additional fees you add, make sure they are clear to the customer. Hidden fees are one of the leading causes of cart abandonment. Therefore, we recommend being transparent about it.
If you have any problem adding custom fees to your WooCommerce store, you can let us know in the comments section, so we can help you.