Developer Advisory: Flat Rate shipping separators in WooCommerce 9.0.1

The Details

In WooCommerce 9.0 a bug fix was submitted correcting a problem in which free shipping would be offered to customers, even if a valid flat rate had been defined in the settings. A little more specifically, this would occur if the flat rate was entered using decimal and thousand separators (for example, “1,000.00” instead of “1000”).

However, following the introduction of this fix, we identified two new issues that also impact Flat Rate shipping (which is an optional shipping method that can be added and defined via WooCommerce Settings > Shipping). 

To the best of our knowledge, using the same symbol for both inputs is very unusual, and so we expect that very few merchants will be impacted by this.

Issue 1: Flat Rate separators in general settings

When both the thousands/decimal inputs are set to the same symbol (for example, if they are both set to a dot/period symbol) in WooCommerce > Settings > General, the user will experience issues with Flat Rate shipping method in both the admin settings and checkout process:

When adding a Flat Rate shipping method to any of the shipping zones in WooCommerce > Settings > Shipping > Shipping Zones and saving it, the Flat Rate cost will multiply on both the Flat Rate cost settings page and the checkout. For example, if you entered $10.00 Flat Rate cost, it will become $1.000.00 in the Flat Rate cost field and $1000.00 at the checkout. 

Issue 2: Separator use in Flat Rate shipping value definition

When the thousands input is set to the dot/period symbol and the decimal input is set to the comma symbol in WooCommerce > Settings > General, and if the Flat Rate cost itself was set to $10,00 (‘ten’), then the user will see a flat rate shipping charge of $1.000,00 (‘one thousand’) during checkout.

The same issue will be present if a dot is used in the Flat Rate cost as a decimal separator, but a comma is set in the general settings, or vice versa.

How Can I Tell If This Affects Me?

You may be affected if you have defined one or more Flat Rate shipping options; and if you have set the thousands and decimal separator fields to the exact same symbol.

This is a configuration issue, so any country’s shipping setting for Flat Rate can be affected. 

Note that using the dot (.) for both a decimal separator and a thousand separator would lead to significant confusion and is not a standard practice in any country’s official numerical formatting. Typically, a country uses one symbol for the decimal separator (either a dot or a comma) and a different symbol for the thousand separator to avoid ambiguity.

You may also be affected even if you use different separators in the thousands/decimal inputs but don’t follow the settings when setting up Flat Rate cost. For example, if you set a dot (.) as a Decimal separator in general settings but enter a comma (,) as a Decimal separator when setting the Flat Rate cost. 

Immediate Actions We Are Taking

We are still evaluating the best approach to implement a fix for these issues; we will either follow up with a 9.0 dot release sometime next week, or include the fix in the upcoming 9.1 release. 

What Action Should I Take?

Note: the behaviour that this workaround fixes is only present in WooCommerce 9.0 and 9.0.1. WooCommerce 9.0.2 restores the behaviour present in WooCommerce 8.9 and earlier. Thousand separators are not officially supported in these versions.

View Post

If you are currently utilizing the Flat Rate shipping option, please set your thousands input to , and the decimal input to . . Or, conversely, if you typically use a . in your thousands input – make sure your decimal input is then a , .

If a Flat Rate shipping price is defined, double check your input value to only include the separator values defined in your Thousands/Decimal inputs. Test your product with the defined Flat Rate shipping price to make sure none of your values seem off or inflated. 

Still having issues? Please reach out to us in the comments section. 


Keep yourself in the loop!

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form


7 responses to “Developer Advisory: Flat Rate shipping separators in WooCommerce 9.0.1”

  1. danielspain Avatar
    danielspain

    Hi, are sites that do not use shipping options of any kind(disabled shipping options in wc settings, sites that sell virtual products with no shipping of any kind, includinf flat rate) affected at all? thanks in advance

    1. Shani Banerjee Avatar
      Shani Banerjee

      Hi danielspain! No, you would not be affected. Only stores that are specifically using the flat rate shipping option would potentially be affected.

      It’s a very limited amount of stores with a very specific use case that would be affected, but alas, it’s better to make sure everyone is aware and proactive. 🙂

      1. danielspain Avatar
        danielspain

        thanks!

  2. Osiris M. Avatar
    Osiris M.

    I think there was an error in how shipping costs floats where evaluated in the past.

    My shop is based in Spain. I always set my thousand separator to dot and decimals to comma.

    Before 9.0, I always had to input my shipping costs with dot separators for decimals even if I had comma for decimals set up.

    In fact, I have the exact same shop on production (WC 8.9) and a local server (WC 9.0.1), and I the one with WC 8.9 need to have the shipping costs with dots for decimals to work as expected.

  3. Why this problem isn’t giving more priority to fix? We’ve a lot off clients and have to check the webshops manual now to correct these bug.

    1. Hi Kees, the engineering team is working on a fix that is planned to be released soon.

      1. Thanks! I saw the fix, great work. Thanks for your fast response.

Leave a Reply

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