WordPress как на ладони
Очень Удобный и Быстрый Хостинг для сайтов на WordPress. Пользуюсь сам и вам рекомендую!
событие не описано

woocommerce_flat_rate_shipping_add_rate хук-событие . WC 1.0

Developers can add additional flat rates based on this one via this action since @version 2.4.

Ищем WP-разработчика! Фулл-тайм, удаленка, хорошая зарплата, соц. пакет. Подробности.
Компания Boosta.

Previously there were (overly complex) options to add additional rates however this was not user. friendly and goes against what Flat Rate Shipping was originally intended for.

This example shows how you can add an extra rate based on this flat rate via custom function:

add_action( 'woocommerce_flat_rate_shipping_add_rate', 'add_another_custom_flat_rate', 10, 2 );
function add_another_custom_flat_rate( $method, $rate ) {
	$new_rate          = $rate;
	$new_rate['id']    .= ':' . 'custom_rate_name'; // Append a custom ID.
	$new_rate['label'] = 'Rushed Shipping'; // Rename to 'Rushed Shipping'.
	$new_rate['cost']  += 2; // Add $2 to the cost.

// Add it to WC. $method->add_rate( $new_rate );



add_action( 'woocommerce_flat_rate_shipping_add_rate', 'action_function_name_4766', 10, 2 );
function action_function_name_4766( $that, $rate ){
	// action...

Где вызывается хук

woocommerce/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php 255
do_action( 'woocommerce_flat_rate_shipping_add_rate', $this, $rate );

Где используется хук в ядре WooCommerce

woocommerce/includes/shipping/legacy-flat-rate/class-wc-shipping-legacy-flat-rate.php 41
add_action( 'woocommerce_flat_rate_shipping_add_rate', array( $this, 'calculate_extra_shipping' ), 10, 2 );