Change ordering with woocommerce_package_rates
-
Hello.
I’m trying to change the ordering of shipping methods by putting wc_pickup_store on the bottom of the shipping method list with the help of the following array:add_filter( 'woocommerce_package_rates', 'hide_shipping_method_based_on_shipping_class', 10, 2 ); function hide_shipping_method_based_on_shipping_class( $rates, $package ) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; if (isset($rates['wc_pickup_store'])) { $wc_pickup_store = $rates['wc_pickup_store']; unset($rates['wc_pickup_store']); array_push($rates,$wc_pickup_store); } return $rates; }
The issue is that while it’s moved, when selected, the wc-pickup-store select box is not appearing.
Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Change ordering with woocommerce_package_rates’ is closed to new replies.