1function wc_ninja_change_flat_rates_cost( $rates, $package ) {
2
3 // Make sure flat rate is available
4 // '13' is Flat Rate ID (What you Define)
5 if ( isset( $rates['flat_rate:13'] ) ) {
6 // Set the cost to $100
7 $rates['flat_rate:13']->cost = 60;
8
9 }
10 return $rates;
11}
12
13add_filter( 'woocommerce_package_rates', 'wc_ninja_change_flat_rates_cost', 10, 2 );
14