woocommerce_shipping_rate_cost
Filter the shipping rate cost.
Использование
add_filter( 'woocommerce_shipping_rate_cost', 'wp_kama_woocommerce_shipping_rate_cost_filter', 10, 2 );
/**
* Function for `woocommerce_shipping_rate_cost` filter-hook.
*
* @param string $cost The shipping rate cost.
* @param WC_Shipping_Rate $that The shipping rate object.
*
* @return string
*/
function wp_kama_woocommerce_shipping_rate_cost_filter( $cost, $that ){
// filter...
return $cost;
}
- $cost(строка)
- The shipping rate cost.
- $that(WC_Shipping_Rate)
- The shipping rate object.
Список изменений
| С версии 3.2.0 | Введена. |
Где вызывается хук
woocommerce_shipping_rate_cost
woocommerce/includes/class-wc-shipping-rate.php 302
return apply_filters( 'woocommerce_shipping_rate_cost', $this->data['cost'], $this );