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

Filter the calculated shipping rates.

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

add_filter( 'woocommerce_package_rates', 'wp_kama_woocommerce_package_rates_filter', 10, 2 );

/**
 * Function for `woocommerce_package_rates` filter-hook.
 * 
 * @param array $package['rates'] Package rates.
 * @param array $package          Package of cart items.
 *
 * @return array
 */
function wp_kama_woocommerce_package_rates_filter( $package['rates'], $package ){

	// filter...
	return $package['rates'];
}
$package['rates'](массив)
Package rates.
$package(массив)
Package of cart items.

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

WC_Shipping::calculate_shipping_for_package()
woocommerce_package_rates
woocommerce/includes/class-wc-shipping.php 368
$package['rates'] = apply_filters( 'woocommerce_package_rates', $package['rates'], $package );

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

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