woocommerce_package_rates

Using this filter, we can edit shipping methods.

In this filter we will get current shipping packages details (free shipping, flat rate or some other packages)

Sample:

function all_shipping_methods( $rates ) {

file_put_contents(‘myfile.txt’,print_r($rates,’true’));

// Here all shipping methods will be displayed in ‘myfile.txt’ file.

}

add_filter( ‘woocommerce_package_rates’,’ all_shipping_methods’);