woocommerce_shipping_calculator_enable_state
Filter to not require shipping state for shipping calculation, even if it is required at checkout. This can be used to allow shipping calculations to be done without a state.
Использование
add_filter( 'woocommerce_shipping_calculator_enable_state', 'wp_kama_woocommerce_shipping_calculator_enable_state_filter' ); /** * Function for `woocommerce_shipping_calculator_enable_state` filter-hook. * * @param bool $show_state Whether to use the state field. * * @return bool */ function wp_kama_woocommerce_shipping_calculator_enable_state_filter( $show_state ){ // filter... return $show_state; }
- $show_state(true|false)
- Whether to use the state field.
По умолчанию: true
Список изменений
С версии 8.4.0 | Введена. |
Где вызывается хук
woocommerce_shipping_calculator_enable_state
woocommerce/includes/class-wc-cart.php 1585
$state_enabled = apply_filters( 'woocommerce_shipping_calculator_enable_state', true );
woocommerce/templates/cart/shipping-calculator.php 42
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_state', true ) ) : ?>