woocommerce_calculated_total хук-фильтрWC 1.0

Allow plugins to filter the grand total, and sum the cart totals in case of modifications.

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

add_filter( 'woocommerce_calculated_total', 'wp_kama_woocommerce_calculated_total_filter', 10, 2 );

/**
 * Function for `woocommerce_calculated_total` filter-hook.
 * 
 * @param  $total 
 * @param  $cart  
 *
 * @return 
 */
function wp_kama_woocommerce_calculated_total_filter( $total, $cart ){

	// filter...
	return $total;
}
$total
-
$cart
-

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

WC_Cart_Totals::calculate_totals()
woocommerce_calculated_total
woocommerce/includes/class-wc-cart-totals.php 877
$this->cart->set_total( max( 0, apply_filters( 'woocommerce_calculated_total', $this->get_total( 'total' ), $this->cart ) ) );

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

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