WooCommerce Core

Simplifying Flat Rate Shipping in WC 2.4

One of our main goals with the upcoming 2.4 release has been usability, particularly for new users. A good example of this being the new onboarding wizard which should help new users get started without seeing complex settings screens.

Shipping has always been problematic in terms of complexity, but has gotten worse over the year(s) due to feature requests and trying to account for more advanced use cases. Flat Rate Shipping is supposed to be simple. But lets look at the 2.3 UI for this a moment:

2015-06-16 at 12.15

Rather than having just a ‘flat rate’ we have additional costs (that can be per order, class or item), shipping classes with more costs and fees, add-on rates… A new user, or user new to eCommerce in general, is not going to understand all of these options. It’s just overwhelming. And using the various options correctly is not easy and mistakes are easy to make.

In support we see flat rate troubling users often. In our premium support area, at least 15% of all shipping tickets have been related to flat rate shipping. And so with 2.4 we challenged ourselves to simplify this shipping method.

Lets look at what we can do with the current UI. We can:

  1. Set a cost for the order (flat rate)
  2. Set a cost for each type of product by shipping class
  3. Set a handling fee per type of product, with a minimum fee if needed
  4. Charge the additional costs per order, class, or item.
  5. Offer extra rates with a small increase in cost (add-on rates)

With any simplification points 1 to 4 need to be ‘supported’ to prevent breakage to existing flat rates. Also:

  • Point 1 is the most important field as its key to having a flat rate.
  • Point 2 should only be shown when needed i.e. when the user has product shipping classes, not beforehand.
  • Point 3 should not be a separate field; the costs are merged anyway, so extra fields will cause confusion when it behaves no differently in use.
  • Point 4 only applies to point 2 and 3 and should somehow be reworded or moved to prevent confusion with the main cost field (1).
  • Point 5, which is for extra rates, should be supported if in use, but is too hard for new users to make use of and thus should be dropped from the UI (with a code fallback to keep it possible and easy to implement if needed).

Here is our solution.

Removing all the things

This may shock users at first, but lets look at our new Flat Rate UI for a new user without shipping classes setup yet, and no existing settings.

2015-06-16 at 12.41

That’s it. Nothing scary – just a cost field to add a flat rate, as it says on the tin. This covers point 1.

Now lets assume the user creates a product shipping class. This is what they will see:

2015-06-16 at 12.44

Still not overwhelming. The user has created a shipping class and thus knows what they are. There is also only one cost field; no extra fee field. Finally, the calculation type field which applies only to shipping class costs is visible at this point. This covers points 2, 3 and 4.

What about backwards compatibility?

If a user of 2.3 flat rates upgrades, an upgrade routine will map their old settings to the new settings.

What about add-on rates?

Users of the overly complex add-on rates will still see this field and it will continue to function. New users will never see this field – it will remain hidden. We’ll eventually deprecate this fully.

Hooks will allow easy flat rate additions though usage of a few lines of code, such as:

add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 );
function add_another_custom_flat_rate( $method, $rate ) {
$new_rate = $rate;
$new_rate['id'] .= ':' . 'custom_rate_name'; // Append a custom ID
$new_rate['label'] = 'Rushed Shipping'; // Rename to 'Rushed Shipping'
$new_rate['cost'] += 2; // Add $2 to the cost
// Add it to WC
$method->add_rate( $new_rate );

view raw


hosted with ❤ by GitHub

This gives full control over the extra costing too.

What about power users?

What if you want to charge a flat rate per item? Or a percentage based cost? Or enforce a minimum ‘fee’? You could in the old version, and you can in the new version. The cost fields support sums.

100 for the order, and 10 per item
100 for the order, and 10 per item

There are also cost and fee placeholders:

100 cost and a 10% fee of at least $2.
100 cost and a 10% fee of at least $2.

Again, new users don’t need to worry about this, but it’s there when needed and will work after upgrading.

What about international shipping?

The international delivery shipping method, loosely based on flat rate shipping, will be identical bar some extra availability fields to limit countries that can use it.

Trying it out

Want to experiment with Flat Rates? Until merged into master, the branch is here. The code is now in our master development branch.

Thanks for reading!

By Mike Jolley

Mike Jolley is a tech hobbyist, astrophotographer, retro gamer, and software engineer who works at Automattic and contributes to open-source projects such as WordPress and WooCommerce.

20 replies on “Simplifying Flat Rate Shipping in WC 2.4”

Liking this update. Can I use minimum/maximum in the Cost field (for power users), e.g.:

if [qty] >3, 2.00*[qty]

or should I go with a table rate for shipping plugin that has more features?


I understand the need to simplify, but the ability to define additional shipping methods, such as ‘Next day delivery’, is a common requirement. I think a lot of people were using the old UI feature. Now we have to buy a plugin. I suspect the decision was to also create a revenue opportunity, otherwise, the ability to create shipping methods would have simply been moved out of flat rate to another shipping option page. Please, please can you provide a UI to do this without requiring paid plugin? Thank you.


We had an additional shipping option in flat rate which was for next day shipping at an extra fee. Since the update – our next day shipping option has now vanished. How do we add this back on on?


Is there a way to add extra flat rates? We have about 3 big shippers with all different rates. I would like to have a f.e. dropdown for buyers so they can choose which shippingcompany they want to use.


Am i missing it?
1st item ships for $7. if they order more than 1 item, then shipping rate goes up $3 per additional item.

Is there an easy way to do this?


Sorry, just hit the post comment by accident… Is there a list or guide to these cost sum “shortcodes” such as [qty] or [fee percent]? A little more info on this would solve all my problems.



Comments are closed.