WooCommerce Shipping – Set a particular service as default in Cart
In this article, we will guide you 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 use WooCommerce FedEx Shipping Plugin. He prefers “FedEx Ground” as 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 in Appearance –>Editor –> functions.php.
As per the above snippet, FedEx Ground should be the default shipping method. Before implementing our solution, “FedEx First Overnight” was shown as default.
After implementation of this solution, “FedEx Ground” is being shown as default!
How to set the cheapest shipping method as default?
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:
Consider that Roger wants to introduce a flat rate for customers from Georgia as his warehouse is located at Atlanta. So it becomes easy and cheap for him to ship goods to any location in Georgia. As a consequence of this, 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!