WooCommerce Shipping – Sort Shipping Options/Methods/Services by Shipment Cost

WooCommerce doesn’t sort shipping options/services by default while showing it on the Cart and Checkout page. In this guide, we are going to help you sort Shipping methods based on shipping cost on your WooCommerce store.

In order to achieve the business case, you must add in the Code Snippet mentioned below.

Code Snippet to Sort Shipping Options by Cost

Below code snippet will help to sort the shipping options by shipping cost.

Screenshot – Shipping Options – Default view.

Woocommerce shipping services on cart page

Screenshot – Shipping Options – Sorted view.

reduced woocommerce shipping rates

 

12 thoughts on “WooCommerce Shipping – Sort Shipping Options/Methods/Services by Shipment Cost

  1. Marc says:

    This used to work up until we upgraded woocommerce to 3.2.5 and wordpress to 4.9.1 now when something is added to the cart, it returns this error:

    Warning: array_keys() expects parameter 1 to be array, null given in /home4/ffxbmeus/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 478

    Warning: array_keys() expects parameter 1 to be array, null given in /home4/ffxbmeus/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 449

    Warning: current() expects parameter 1 to be array, null given in /home4/ffxbmeus/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 450

    Warning: array_keys() expects parameter 1 to be array, null given in /home4/ffxbmeus/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 478

    Warning: array_keys() expects parameter 1 to be array, null given in /home4/ffxbmeus/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 449

    Warning: current() expects parameter 1 to be array, null given in /home4/ffxbmeus/public_html/wp-content/plugins/woocommerce/includes/wc-cart-functions.php on line 450

    • Anindo
      Anindo C says:

      Hi Marc,

      We tested this on our side but could not replicate the issue. Would it be possible for you to approach our support team on this so that they can resolve the problem? Here is the URL of support.

Leave a Reply