WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
событие не описано

woocommerce_(id)_shipping_add_rate хук-событие . WC 1.0

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

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.


add_action( 'woocommerce_(id)_shipping_add_rate', 'action_function_name_8937', 10, 2 );
function action_function_name_8937( $that, $rate ){
	// action...

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

woocommerce/includes/shipping/flat-rate/class-wc-shipping-flat-rate.php 216
do_action( 'woocommerce_' . $this->id . '_shipping_add_rate', $this, $rate );

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

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