abstracts
1 month ago
admin
6 days ago
blocks
11 months ago
cli
1 month ago
customizer
4 months ago
data-stores
1 month ago
emails
6 days ago
export
1 year ago
gateways
1 month ago
import
3 months ago
integrations
2 months ago
interfaces
4 months ago
legacy
4 months ago
libraries
1 month ago
log-handlers
1 year ago
payment-tokens
5 years ago
product-usage
1 year ago
queue
4 months ago
react-admin
1 month ago
rest-api
1 month ago
shipping
3 months ago
shortcodes
1 month ago
theme-support
2 years ago
tracks
1 month ago
traits
5 years ago
walkers
5 years ago
wccom-site
1 month ago
widgets
2 months ago
class-wc-ajax.php
1 month ago
class-wc-auth.php
1 year ago
class-wc-autoloader.php
9 months ago
class-wc-background-emailer.php
2 months ago
class-wc-background-updater.php
5 years ago
class-wc-brands-brand-settings-manager.php
1 year ago
class-wc-brands-coupons.php
1 year ago
class-wc-brands.php
1 month ago
class-wc-breadcrumb.php
4 months ago
class-wc-cache-helper.php
1 month ago
class-wc-cart-fees.php
2 years ago
class-wc-cart-session.php
3 months ago
class-wc-cart-totals.php
11 months ago
class-wc-cart.php
1 month ago
class-wc-checkout.php
1 month ago
class-wc-cli.php
10 months ago
class-wc-comments.php
4 months ago
class-wc-countries.php
2 months ago
class-wc-coupon.php
2 months ago
class-wc-customer-download-log.php
5 years ago
class-wc-customer-download.php
1 year ago
class-wc-customer.php
1 day ago
class-wc-data-exception.php
8 years ago
class-wc-data-store.php
3 years ago
class-wc-datetime.php
4 years ago
class-wc-deprecated-action-hooks.php
2 years ago
class-wc-deprecated-filter-hooks.php
3 months ago
class-wc-discounts.php
11 months ago
class-wc-download-handler.php
1 month ago
class-wc-emails.php
1 month ago
class-wc-embed.php
1 year ago
class-wc-form-handler.php
3 months ago
class-wc-frontend-scripts.php
2 months ago
class-wc-geo-ip.php
9 months ago
class-wc-geolite-integration.php
6 years ago
class-wc-geolocation.php
2 months ago
class-wc-https.php
3 years ago
class-wc-install.php
6 days ago
class-wc-integrations.php
5 years ago
class-wc-log-levels.php
2 years ago
class-wc-logger.php
4 months ago
class-wc-meta-data.php
1 month ago
class-wc-order-factory.php
2 months ago
class-wc-order-item-coupon.php
4 years ago
class-wc-order-item-fee.php
5 months ago
class-wc-order-item-meta.php
4 years ago
class-wc-order-item-product.php
1 month ago
class-wc-order-item-shipping.php
5 months ago
class-wc-order-item-tax.php
1 month ago
class-wc-order-item.php
1 month ago
class-wc-order-query.php
1 month ago
class-wc-order-refund.php
1 year ago
class-wc-order.php
1 month ago
class-wc-payment-gateways.php
1 month ago
class-wc-payment-tokens.php
3 years ago
class-wc-post-data.php
2 months ago
class-wc-post-types.php
1 month ago
class-wc-privacy-background-process.php
1 year ago
class-wc-privacy-erasers.php
10 months ago
class-wc-privacy-exporters.php
4 years ago
class-wc-privacy.php
1 year ago
class-wc-product-attribute.php
4 months ago
class-wc-product-download.php
4 months ago
class-wc-product-external.php
1 year ago
class-wc-product-factory.php
3 months ago
class-wc-product-grouped.php
3 months ago
class-wc-product-query.php
4 months ago
class-wc-product-simple.php
11 months ago
class-wc-product-variable.php
1 month ago
class-wc-product-variation.php
1 month ago
class-wc-query.php
1 month ago
class-wc-rate-limiter.php
4 years ago
class-wc-regenerate-images-request.php
3 years ago
class-wc-regenerate-images.php
2 years ago
class-wc-register-wp-admin-settings.php
5 years ago
class-wc-rest-authentication.php
2 years ago
class-wc-rest-exception.php
5 years ago
class-wc-session-handler.php
3 months ago
class-wc-shipping-rate.php
1 year ago
class-wc-shipping-zone.php
5 years ago
class-wc-shipping-zones.php
7 months ago
class-wc-shipping.php
2 months ago
class-wc-shortcodes.php
1 year ago
class-wc-structured-data.php
1 month ago
class-wc-tax.php
2 months ago
class-wc-template-loader.php
7 months ago
class-wc-tracker.php
1 month ago
class-wc-validation.php
2 years ago
class-wc-webhook.php
1 month ago
class-woocommerce.php
1 day ago
wc-account-functions.php
1 month ago
wc-attribute-functions.php
1 month ago
wc-brands-functions.php
1 year ago
wc-cart-functions.php
1 month ago
wc-conditional-functions.php
11 months ago
wc-core-functions.php
2 months ago
wc-coupon-functions.php
5 months ago
wc-deprecated-functions.php
1 month ago
wc-formatting-functions.php
1 month ago
wc-interactivity-api-functions.php
2 months ago
wc-notice-functions.php
5 months ago
wc-order-functions.php
1 month ago
wc-order-item-functions.php
3 years ago
wc-order-step-logger-functions.php
4 months ago
wc-page-functions.php
1 month ago
wc-product-functions.php
2 months ago
wc-rest-functions.php
7 months ago
wc-stock-functions.php
7 months ago
wc-template-functions.php
1 month ago
wc-template-hooks.php
10 months ago
wc-term-functions.php
2 months ago
wc-update-functions.php
6 days ago
wc-user-functions.php
1 month ago
wc-webhook-functions.php
1 month ago
wc-widget-functions.php
5 years ago
class-wc-shipping.php
450 lines
| 1 | <?php |
| 2 | /** |
| 3 | * WooCommerce Shipping |
| 4 | * |
| 5 | * Handles shipping and loads shipping methods via hooks. |
| 6 | * |
| 7 | * @version 2.6.0 |
| 8 | * @package WooCommerce\Classes\Shipping |
| 9 | */ |
| 10 | |
| 11 | use Automattic\Jetpack\Constants; |
| 12 | use Automattic\WooCommerce\StoreApi\Utilities\LocalPickupUtils; |
| 13 | |
| 14 | if ( ! defined( 'ABSPATH' ) ) { |
| 15 | exit; |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Shipping class. |
| 20 | */ |
| 21 | class WC_Shipping { |
| 22 | |
| 23 | /** |
| 24 | * True if shipping is enabled. |
| 25 | * |
| 26 | * @var bool |
| 27 | */ |
| 28 | public $enabled = false; |
| 29 | |
| 30 | /** |
| 31 | * Stores methods loaded into woocommerce. |
| 32 | * |
| 33 | * @var array|null |
| 34 | */ |
| 35 | public $shipping_methods = null; |
| 36 | |
| 37 | /** |
| 38 | * Stores the shipping classes. |
| 39 | * |
| 40 | * @var array |
| 41 | */ |
| 42 | public $shipping_classes = array(); |
| 43 | |
| 44 | /** |
| 45 | * Stores packages to ship and to get quotes for. |
| 46 | * |
| 47 | * @var array |
| 48 | */ |
| 49 | public $packages = array(); |
| 50 | |
| 51 | /** |
| 52 | * The single instance of the class |
| 53 | * |
| 54 | * @var WC_Shipping |
| 55 | * @since 2.1 |
| 56 | */ |
| 57 | protected static $_instance = null; |
| 58 | |
| 59 | /** |
| 60 | * Main WC_Shipping Instance. |
| 61 | * |
| 62 | * Ensures only one instance of WC_Shipping is loaded or can be loaded. |
| 63 | * |
| 64 | * @since 2.1 |
| 65 | * @return WC_Shipping Main instance |
| 66 | */ |
| 67 | public static function instance() { |
| 68 | if ( is_null( self::$_instance ) ) { |
| 69 | self::$_instance = new self(); |
| 70 | } |
| 71 | return self::$_instance; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Cloning is forbidden. |
| 76 | * |
| 77 | * @since 2.1 |
| 78 | */ |
| 79 | public function __clone() { |
| 80 | wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woocommerce' ), '2.1' ); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Unserializing instances of this class is forbidden. |
| 85 | * |
| 86 | * @since 2.1 |
| 87 | */ |
| 88 | public function __wakeup() { |
| 89 | wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ), '2.1' ); |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Magic getter. |
| 94 | * |
| 95 | * @param string $name Property name. |
| 96 | * @return mixed |
| 97 | */ |
| 98 | public function __get( $name ) { |
| 99 | // Grab from cart for backwards compatibility with versions prior to 3.2. |
| 100 | if ( 'shipping_total' === $name ) { |
| 101 | return WC()->cart->get_shipping_total(); |
| 102 | } |
| 103 | if ( 'shipping_taxes' === $name ) { |
| 104 | return WC()->cart->get_shipping_taxes(); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Initialize shipping. |
| 110 | */ |
| 111 | public function __construct() { |
| 112 | $this->enabled = wc_shipping_enabled(); |
| 113 | |
| 114 | if ( $this->enabled ) { |
| 115 | $this->init(); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Initialize shipping. |
| 121 | */ |
| 122 | public function init() { |
| 123 | do_action( 'woocommerce_shipping_init' ); |
| 124 | } |
| 125 | |
| 126 | /** |
| 127 | * Shipping methods register themselves by returning their main class name through the woocommerce_shipping_methods filter. |
| 128 | * |
| 129 | * @return array |
| 130 | */ |
| 131 | public function get_shipping_method_class_names() { |
| 132 | // Unique Method ID => Method Class name. |
| 133 | $shipping_methods = array( |
| 134 | 'flat_rate' => 'WC_Shipping_Flat_Rate', |
| 135 | 'free_shipping' => 'WC_Shipping_Free_Shipping', |
| 136 | 'local_pickup' => 'WC_Shipping_Local_Pickup', |
| 137 | ); |
| 138 | |
| 139 | // For backwards compatibility with 2.5.x we load any ENABLED legacy shipping methods here. |
| 140 | $maybe_load_legacy_methods = array( 'flat_rate', 'free_shipping', 'international_delivery', 'local_delivery', 'local_pickup' ); |
| 141 | |
| 142 | // Prime caches to reduce future queries. |
| 143 | wp_prime_option_caches( array_map( fn( string $method ) => sprintf( 'woocommerce_%s_settings', $method ), $maybe_load_legacy_methods ) ); |
| 144 | |
| 145 | foreach ( $maybe_load_legacy_methods as $method ) { |
| 146 | $options = get_option( 'woocommerce_' . $method . '_settings' ); |
| 147 | if ( $options && isset( $options['enabled'] ) && 'yes' === $options['enabled'] ) { |
| 148 | $shipping_methods[ 'legacy_' . $method ] = 'WC_Shipping_Legacy_' . $method; |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | return apply_filters( 'woocommerce_shipping_methods', $shipping_methods ); |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Loads all shipping methods which are hooked in. |
| 157 | * If a $package is passed, some methods may add themselves conditionally and zones will be used. |
| 158 | * |
| 159 | * @param array $package Package information. |
| 160 | * @return WC_Shipping_Method[] |
| 161 | */ |
| 162 | public function load_shipping_methods( $package = array() ) { |
| 163 | if ( ! empty( $package ) ) { |
| 164 | $debug_mode = 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ); |
| 165 | $shipping_zone = WC_Shipping_Zones::get_zone_matching_package( $package ); |
| 166 | $this->shipping_methods = $shipping_zone->get_shipping_methods( true ); |
| 167 | |
| 168 | // translators: %s: shipping zone name. |
| 169 | $matched_zone_notice = sprintf( __( 'Customer matched zone "%s"', 'woocommerce' ), $shipping_zone->get_zone_name() ); |
| 170 | |
| 171 | // Debug output. |
| 172 | if ( $debug_mode && ! Constants::is_defined( 'WOOCOMMERCE_CHECKOUT' ) && ! Constants::is_defined( 'WC_DOING_AJAX' ) && ! wc_has_notice( $matched_zone_notice ) ) { |
| 173 | wc_add_notice( $matched_zone_notice ); |
| 174 | } |
| 175 | } else { |
| 176 | $this->shipping_methods = array(); |
| 177 | } |
| 178 | |
| 179 | // For the settings in the backend, and for non-shipping zone methods, we still need to load any registered classes here. |
| 180 | foreach ( $this->get_shipping_method_class_names() as $method_id => $method_class ) { |
| 181 | $this->register_shipping_method( $method_class ); |
| 182 | } |
| 183 | |
| 184 | // Methods can register themselves manually through this hook if necessary. |
| 185 | do_action( 'woocommerce_load_shipping_methods', $package ); |
| 186 | |
| 187 | // Return loaded methods. |
| 188 | return $this->get_shipping_methods(); |
| 189 | } |
| 190 | |
| 191 | /** |
| 192 | * Register a shipping method. |
| 193 | * |
| 194 | * @param object|string $method Either the name of the method's class, or an instance of the method's class. |
| 195 | * |
| 196 | * @return bool|void |
| 197 | */ |
| 198 | public function register_shipping_method( $method ) { |
| 199 | if ( ! is_object( $method ) ) { |
| 200 | if ( ! class_exists( $method ) ) { |
| 201 | return false; |
| 202 | } |
| 203 | $method = new $method(); |
| 204 | } |
| 205 | if ( is_null( $this->shipping_methods ) ) { |
| 206 | $this->shipping_methods = array(); |
| 207 | } |
| 208 | $this->shipping_methods[ $method->id ] = $method; |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * Unregister shipping methods. |
| 213 | */ |
| 214 | public function unregister_shipping_methods() { |
| 215 | $this->shipping_methods = null; |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Returns all registered shipping methods for usage. |
| 220 | * |
| 221 | * @return WC_Shipping_Method[] |
| 222 | */ |
| 223 | public function get_shipping_methods() { |
| 224 | if ( is_null( $this->shipping_methods ) ) { |
| 225 | $this->load_shipping_methods(); |
| 226 | } |
| 227 | return $this->shipping_methods; |
| 228 | } |
| 229 | |
| 230 | /** |
| 231 | * Get an array of shipping classes. |
| 232 | * |
| 233 | * @return array |
| 234 | */ |
| 235 | public function get_shipping_classes() { |
| 236 | if ( empty( $this->shipping_classes ) ) { |
| 237 | $classes = get_terms( |
| 238 | 'product_shipping_class', |
| 239 | array( |
| 240 | 'hide_empty' => '0', |
| 241 | 'orderby' => 'name', |
| 242 | ) |
| 243 | ); |
| 244 | $this->shipping_classes = ! is_wp_error( $classes ) ? $classes : array(); |
| 245 | } |
| 246 | return apply_filters( 'woocommerce_get_shipping_classes', $this->shipping_classes ); |
| 247 | } |
| 248 | |
| 249 | /** |
| 250 | * Calculate shipping for (multiple) packages of cart items. |
| 251 | * |
| 252 | * @param array $packages multi-dimensional array of cart items to calc shipping for. |
| 253 | * @return array Array of calculated packages. |
| 254 | */ |
| 255 | public function calculate_shipping( $packages = array() ) { |
| 256 | $this->packages = array(); |
| 257 | |
| 258 | if ( ! $this->enabled || empty( $packages ) ) { |
| 259 | return array(); |
| 260 | } |
| 261 | |
| 262 | // Calculate costs for passed packages. |
| 263 | foreach ( $packages as $package_key => $package ) { |
| 264 | $this->packages[ $package_key ] = $this->calculate_shipping_for_package( $package, $package_key ); |
| 265 | } |
| 266 | |
| 267 | /** |
| 268 | * Allow packages to be reorganized after calculating the shipping. |
| 269 | * |
| 270 | * This filter can be used to apply some extra manipulation after the shipping costs are calculated for the packages |
| 271 | * but before WooCommerce does anything with them. A good example of usage is to merge the shipping methods for multiple |
| 272 | * packages for marketplaces. |
| 273 | * |
| 274 | * @since 2.6.0 |
| 275 | * |
| 276 | * @param array $packages The array of packages after shipping costs are calculated. |
| 277 | */ |
| 278 | $this->packages = array_filter( (array) apply_filters( 'woocommerce_shipping_packages', $this->packages ) ); |
| 279 | |
| 280 | return $this->packages; |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * See if package is shippable. |
| 285 | * |
| 286 | * Packages are shippable until proven otherwise e.g. after getting a shipping country. |
| 287 | * |
| 288 | * @param array $package Package of cart items. |
| 289 | * @return bool |
| 290 | */ |
| 291 | public function is_package_shippable( $package ) { |
| 292 | // Packages are shippable until proven otherwise. |
| 293 | if ( empty( $package['destination']['country'] ) ) { |
| 294 | return true; |
| 295 | } |
| 296 | |
| 297 | $allowed = array_keys( WC()->countries->get_shipping_countries() ); |
| 298 | return in_array( $package['destination']['country'], $allowed, true ); |
| 299 | } |
| 300 | |
| 301 | /** |
| 302 | * Calculate shipping rates for a package, |
| 303 | * |
| 304 | * Calculates each shipping methods cost. Rates are stored in the session based on the package hash to avoid re-calculation every page load. |
| 305 | * |
| 306 | * @param array $package Package of cart items. |
| 307 | * @param int $package_key Index of the package being calculated. Used to cache multiple package rates. |
| 308 | * |
| 309 | * @return array|bool |
| 310 | */ |
| 311 | public function calculate_shipping_for_package( $package = array(), $package_key = 0 ) { |
| 312 | // If shipping is disabled or the package is invalid, return false. |
| 313 | if ( ! $this->enabled || empty( $package ) ) { |
| 314 | return false; |
| 315 | } |
| 316 | |
| 317 | $package['rates'] = array(); |
| 318 | |
| 319 | // If the package is not shippable, e.g. trying to ship to an invalid country, do not calculate rates. We can return |
| 320 | // local pickup rates here however since those are not shipped. |
| 321 | $is_shippable = $this->is_package_shippable( $package ); |
| 322 | |
| 323 | // Check if we need to recalculate shipping for this package. |
| 324 | $package_to_hash = $package; |
| 325 | |
| 326 | // Remove data objects so hashes are consistent. |
| 327 | foreach ( $package_to_hash['contents'] as $item_id => $item ) { |
| 328 | unset( $package_to_hash['contents'][ $item_id ]['data'] ); |
| 329 | } |
| 330 | |
| 331 | // Get rates stored in the WC session data for this package. |
| 332 | $wc_session_key = 'shipping_for_package_' . $package_key; |
| 333 | $stored_rates = WC()->session->get( $wc_session_key ); |
| 334 | |
| 335 | // Calculate the hash for this package so we can tell if it's changed since last calculation. |
| 336 | $package_hash = 'wc_ship_' . md5( wp_json_encode( $package_to_hash ) . WC_Cache_Helper::get_transient_version( 'shipping' ) ); |
| 337 | |
| 338 | if ( ! is_array( $stored_rates ) || $package_hash !== $stored_rates['package_hash'] || 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ) ) { |
| 339 | foreach ( $this->load_shipping_methods( $package ) as $shipping_method ) { |
| 340 | // If the package is not shippable and the shipping method does not support local pickup, skip it. |
| 341 | if ( ! $is_shippable && ! LocalPickupUtils::is_local_pickup_method( $shipping_method->id ) ) { |
| 342 | continue; |
| 343 | } |
| 344 | |
| 345 | if ( ! $shipping_method->supports( 'shipping-zones' ) || $shipping_method->get_instance_id() ) { |
| 346 | /** |
| 347 | * Fires before getting shipping rates for a package. |
| 348 | * |
| 349 | * @since 4.3.0 |
| 350 | * @param array $package Package of cart items. |
| 351 | * @param WC_Shipping_Method $shipping_method Shipping method instance. |
| 352 | */ |
| 353 | do_action( 'woocommerce_before_get_rates_for_package', $package, $shipping_method ); |
| 354 | |
| 355 | // Use + instead of array_merge to maintain numeric keys. |
| 356 | $package['rates'] = $package['rates'] + $shipping_method->get_rates_for_package( $package ); |
| 357 | |
| 358 | /** |
| 359 | * Fires after getting shipping rates for a package. |
| 360 | * |
| 361 | * @since 4.3.0 |
| 362 | * @param array $package Package of cart items. |
| 363 | * @param WC_Shipping_Method $shipping_method Shipping method instance. |
| 364 | */ |
| 365 | do_action( 'woocommerce_after_get_rates_for_package', $package, $shipping_method ); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | // Hide shipping rates when free shipping is available. |
| 370 | if ( 'yes' === get_option( 'woocommerce_shipping_hide_rates_when_free', 'no' ) ) { |
| 371 | $free_shipping = array(); |
| 372 | $local_pickup = array(); |
| 373 | |
| 374 | foreach ( $package['rates'] as $rate ) { |
| 375 | if ( 'free_shipping' === $rate->method_id ) { |
| 376 | $free_shipping[ $rate->id ] = $rate; |
| 377 | continue; |
| 378 | } |
| 379 | |
| 380 | if ( $this->shipping_methods[ $rate->method_id ]->supports( 'local-pickup' ) || 'local_pickup' === $rate->method_id ) { |
| 381 | $local_pickup[ $rate->id ] = $rate; |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | if ( ! empty( $free_shipping ) ) { |
| 386 | $package['rates'] = array_merge( $free_shipping, $local_pickup ); |
| 387 | } |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * Filter the calculated shipping rates. |
| 392 | * |
| 393 | * @see https://gist.github.com/woogists/271654709e1d27648546e83253c1a813 for cache invalidation methods. |
| 394 | * @since 2.0.0 |
| 395 | * @param array $package['rates'] Package rates. |
| 396 | * @param array $package Package of cart items. |
| 397 | */ |
| 398 | $package['rates'] = apply_filters( 'woocommerce_package_rates', $package['rates'], $package ); |
| 399 | |
| 400 | // Package rates should be an array, if it was filtered into a non-array, reset it. Don't reset to the |
| 401 | // unfiltered value, as e.g. a 3pd could have set it to "false" to remove rates. |
| 402 | if ( ! is_array( $package['rates'] ) ) { |
| 403 | $package['rates'] = array(); |
| 404 | } |
| 405 | |
| 406 | // Store in session to avoid recalculation. |
| 407 | WC()->session->set( |
| 408 | $wc_session_key, |
| 409 | array( |
| 410 | 'package_hash' => $package_hash, |
| 411 | 'rates' => $package['rates'], |
| 412 | ) |
| 413 | ); |
| 414 | } else { |
| 415 | $package['rates'] = $stored_rates['rates']; |
| 416 | } |
| 417 | |
| 418 | return $package; |
| 419 | } |
| 420 | |
| 421 | /** |
| 422 | * Get packages. |
| 423 | * |
| 424 | * @return array |
| 425 | */ |
| 426 | public function get_packages() { |
| 427 | return $this->packages; |
| 428 | } |
| 429 | |
| 430 | /** |
| 431 | * Reset shipping. |
| 432 | * |
| 433 | * Reset the totals for shipping as a whole. |
| 434 | */ |
| 435 | public function reset_shipping() { |
| 436 | unset( WC()->session->chosen_shipping_methods ); |
| 437 | $this->packages = array(); |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Deprecated |
| 442 | * |
| 443 | * @deprecated 2.6.0 Was previously used to determine sort order of methods, but this is now controlled by zones and thus unused. |
| 444 | */ |
| 445 | public function sort_shipping_methods() { |
| 446 | wc_deprecated_function( 'sort_shipping_methods', '2.6' ); |
| 447 | return $this->shipping_methods; |
| 448 | } |
| 449 | } |
| 450 |