woocommerce_cart_ready_to_calc_shipping
Filter to allow plugins to prevent shipping calculations.
Usage
add_filter( 'woocommerce_cart_ready_to_calc_shipping', 'wp_kama_woocommerce_cart_ready_to_calc_shipping_filter' );
/**
* Function for `woocommerce_cart_ready_to_calc_shipping` filter-hook.
*
* @param bool $ready Whether the cart is ready to calculate shipping.
*
* @return bool
*/
function wp_kama_woocommerce_cart_ready_to_calc_shipping_filter( $ready ){
// filter...
return $ready;
}
- $ready(true|false)
- Whether the cart is ready to calculate shipping.
Changelog
| Since 2.7.0 | Introduced. |
Where the hook is called
woocommerce_cart_ready_to_calc_shipping
woocommerce/includes/class-wc-cart.php 1822
return apply_filters( 'woocommerce_cart_ready_to_calc_shipping', true );
woocommerce/includes/class-wc-cart.php 1765
return apply_filters( 'woocommerce_cart_ready_to_calc_shipping', true );