woocommerce_cart_calculate_fees │ хук-событие │ WC 2.0.0

Trigger an action so 3rd parties can add custom fees.

Использование

add_action( 'woocommerce_cart_calculate_fees', 'wp_kama_woocommerce_cart_calculate_fees_action' );

/**
 * Function for `woocommerce_cart_calculate_fees` action-hook.
 * 
 * @param  $that 
 *
 * @return void
 */
function wp_kama_woocommerce_cart_calculate_fees_action( $that ){
	// action...
}
$that
-

Список изменений

С версии 2.0.0 Введена.

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

WC_Cart::calculate_fees()
woocommerce_cart_calculate_fees
woocommerce/includes/class-wc-cart.php 2295
do_action( 'woocommerce_cart_calculate_fees', $this );

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

woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-paypal-standard-controller.php 203
add_action( 'woocommerce_cart_calculate_fees', $re_add_cart_item_fees );
woocommerce/includes/rest-api/Controllers/Version3/class-wc-rest-paypal-standard-controller.php 259
remove_action( 'woocommerce_cart_calculate_fees', $re_add_cart_item_fees );