From aae956185e5853a861cb96fb5fbfd649d825b435 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Mon, 11 Jan 2016 11:49:02 +0000 Subject: [PATCH] merge conflict --- includes/class-wc-shipping.php | 43 ---------------------------------- 1 file changed, 43 deletions(-) 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. *