芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/flexible-shipping/inc/functions.php
shipping()->load_shipping_methods(); return $all_shipping_methods; } /** * Returns FS methods selected in cart. * * @param string $shipping_method_integration . * * @return bool */ function flexible_shipping_method_selected_in_cart( $shipping_method_integration ) { $chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' ); if ( is_array( $chosen_shipping_methods ) ) { $all_shipping_methods = flexible_shipping_get_all_shipping_methods(); $flexible_shipping = $all_shipping_methods['flexible_shipping']; $flexible_shipping_rates = $flexible_shipping->get_all_rates(); foreach ( $chosen_shipping_methods as $id => $shipping ) { if ( isset( $flexible_shipping_rates[ $shipping ] ) ) { $shipping_method = $flexible_shipping_rates[ $shipping ]; if ( isset( $shipping_method['method_integration'] ) && $shipping_method['method_integration'] === $shipping_method_integration ) { return $shipping_method; } } } } return false; } function flexible_shipping_method_selected( $order, $shipping_method_integration ) { if ( is_numeric( $order ) ) { $order = wc_get_order( $order ); } $shippings = $order->get_shipping_methods(); $all_shipping_methods = flexible_shipping_get_all_shipping_methods(); if ( isset( $all_shipping_methods['flexible_shipping'] ) ) { $flexible_shipping_rates = $all_shipping_methods['flexible_shipping']->get_all_rates(); foreach ( $shippings as $id => $shipping ) { if ( isset( $flexible_shipping_rates[ $shipping['method_id'] ] ) ) { $shipping_method = $flexible_shipping_rates[ $shipping['method_id'] ]; if ( $shipping_method['method_integration'] == $shipping_method_integration ) { return $shipping_method; } } } } return false; } function flexible_shipping_get_integration_for_method( $method_id ) { $all_shipping_methods = flexible_shipping_get_all_shipping_methods(); if ( isset( $all_shipping_methods['flexible_shipping'] ) ) { $flexible_shipping_rates = $all_shipping_methods['flexible_shipping']->get_all_rates(); if ( isset( $flexible_shipping_rates[ $method_id ] ) ) { return $flexible_shipping_rates[ $method_id ]['method_integration']; } } return false; } if ( ! function_exists( 'wpdesk_redirect' ) ) { function wpdesk_redirect( $redirect ) { if ( headers_sent() ) { ?>
', '' ) ); ?>