woocommerce_shipping_chosen_method
Usage
add_filter( 'woocommerce_shipping_chosen_method', 'wp_kama_woocommerce_shipping_chosen_method_filter', 10, 3 ); /** * Function for `woocommerce_shipping_chosen_method` filter-hook. * * @param $default * @param $package_rates * @param $chosen_method * * @return */ function wp_kama_woocommerce_shipping_chosen_method_filter( $default, $package_rates, $chosen_method ){ // filter... return $default; }
- $default
- -
- $package_rates
- -
- $chosen_method
- -
Where the hook is called
woocommerce_shipping_chosen_method
woocommerce/includes/wc-cart-functions.php 462
return apply_filters( 'woocommerce_shipping_chosen_method', $default, $package['rates'], $chosen_method );
Where the hook is used in WooCommerce
woocommerce/src/Blocks/Shipping/ShippingController.php 80
add_filter( 'woocommerce_shipping_chosen_method', array( $this, 'prevent_shipping_method_selection_changes' ), 20, 3 );