WooCommerce Shipping – Set a particular service as default in Cart

In this article, we will guide you on how to set a particular shipping service as the default shipping method when using the WooCommerce FedEx Shipping Plugin with Print Label.

Often WooCommerce shop owners want to provide a default shipping method to their customers. For example, Roger sells bicycles and uses WooCommerce FedEx Shipping Plugin. He prefers “FedEx Ground” as the ground services have a wider reach compared to any other shipping methods. But he cannot show only ground service as there may be customers who sometimes want other options, say, a priority overnight delivery.


How to set a particular shipping service as default in WooCommerce shipping?

It is easy! Now, you can easily do that using the below code snippet.
Just copy the code and paste it into Appearance -->Editor --> functions.php.


No more code snippets and struggling with PHP code to configure your business case!

To maintain compatibility with the latest WordPress version(s) & ease of use we no longer recommend & support usage of the code snippets.

This features is available to as a Customizable Addon with one-time fee.

To get the paid addon, please reach out to our customer support team.


As per the above snippet, FedEx Ground should be the default shipping method. Before implementing our solution, “FedEx First Overnight” was shown as the default option.

fedex overnight

After the implementation of this solution, “FedEx Ground” is shown as the default shipping method on the WooCommerce cart page.

fedex shipping

How to set the cheapest shipping method as the default shipping method on the WooCommerce cart?

Now, what if you want to set the cheapest service as the default one? We have the perfect solution for that too! You just need to use the below snippet:


No more code snippets and struggling with PHP code to configure your business case!

To maintain compatibility with the latest WordPress version(s) & ease of use we no longer recommend & support usage of the code snippets.

This features is available to as a Customizable Addon with one-time fee.

To get the paid addon, please reach out to our customer support team.


Consider that Roger wants to introduce a flat rate for customers from Georgia as his warehouse is located in Atlanta. So it becomes easy and cheap for him to ship goods to any location in Georgia. Consequently, he decides to show the default shipping method as the cheapest one (the Flat Rate service in this case).

After incorporating the above solution, the plugin simply selects the flat rate by default!

cart page

3 thoughts on “WooCommerce Shipping – Set a particular service as default in Cart

  1. chad4
    Chadwick says:

    How do I set UPS Ground as the default?

    Local pick-up is showing first on the list and I keep having customers accidentally choosing it.

    • PluginHive Editorial Team
      PluginHive Editorial Team says:

      Hi Chadwick,

      You can automatically allow the plugin to select the shipping method which you intend to. Here is a code snippet which will by default put the selection for that shipping method. You just need to provide the value of the shipping method in the snippet and then paste it in Appearance –> Editor –> functions.php.

      Hope this helps!

    • chad4
      Chadwick says:

      Anindo,

      I tried chaning “Fedex” to “UPS” in the code above but it did not work. Can you tell me what the specific code would be to make UPS Ground the default selection.

      Many Thanks!

Comments are closed.