woocommerce_order_before_calculate_totals хук-событиеWC 2.2

Calculate totals by looking at the contents of the order. Stores the totals and returns the orders final total.

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

add_action( 'woocommerce_order_before_calculate_totals', 'wp_kama_woocommerce_order_before_calculate_totals_action', 10, 2 );

/**
 * Function for `woocommerce_order_before_calculate_totals` action-hook.
 * 
 * @param bool $and_taxes Calc taxes if true.
 * @param      $that      
 *
 * @return void
 */
function wp_kama_woocommerce_order_before_calculate_totals_action( $and_taxes, $that ){

	// action...
}
$and_taxes(true|false)
Calc taxes if true.
$that
-

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

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

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

WC_Abstract_Order::calculate_totals()
woocommerce_order_before_calculate_totals
woocommerce/includes/abstracts/abstract-wc-order.php 1914
do_action( 'woocommerce_order_before_calculate_totals', $and_taxes, $this );

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

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