diff --git a/includes/class-wc-shipping.php b/includes/class-wc-shipping.php index ea814625bf6..3dc6c5a78ca 100644 --- a/includes/class-wc-shipping.php +++ b/includes/class-wc-shipping.php @@ -172,49 +172,6 @@ class WC_Shipping { $this->shipping_methods = array(); } - /** -<<<<<<< HEAD - * Returns all registered shipping methods. -======= - * Sort shipping methods. - * - * Sorts shipping methods into the user defined order. - * - * @return array - */ - public function sort_shipping_methods() { - - $sorted_shipping_methods = array(); - - // Get order option - $ordering = (array) get_option('woocommerce_shipping_method_order'); - $order_end = 999; - - // Load shipping methods in order - foreach ( $this->shipping_methods as $method ) { - - if ( isset( $ordering[ $method->id ] ) && is_numeric( $ordering[ $method->id ] ) ) { - // Add in position - $sorted_shipping_methods[ $ordering[ $method->id ] ][] = $method; - } else { - // Add to end of the array - $sorted_shipping_methods[ $order_end ][] = $method; - } - } - - ksort( $sorted_shipping_methods ); - - $this->shipping_methods = array(); - - foreach ( $sorted_shipping_methods as $methods ) - foreach ( $methods as $method ) { - $id = empty( $method->instance_id ) ? $method->id : $method->instance_id; - $this->shipping_methods[ $id ] = $method; - } - - return $this->shipping_methods; - } - /** * Returns all registered shipping methods for usage. *