woocommerce_shipping_calculator_enable_postcode filter-hookWC 8.4.0

Filter to not require shipping postcode for shipping calculation, even if it is required at checkout. This can be used to allow shipping calculations to be done without a postcode.


add_filter( 'woocommerce_shipping_calculator_enable_postcode', 'wp_kama_woocommerce_shipping_calculator_enable_postcode_filter' );

 * Function for `woocommerce_shipping_calculator_enable_postcode` filter-hook.
 * @param bool $show_postcode Whether to use the postcode field.
 * @return bool
function wp_kama_woocommerce_shipping_calculator_enable_postcode_filter( $show_postcode ){

	// filter...
	return $show_postcode;
Whether to use the postcode field.
Default: true


Since 8.4.0 Introduced.

Where the hook is called

woocommerce/includes/class-wc-cart.php 1598
$postcode_enabled  = apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true );
woocommerce/templates/cart/shipping-calculator.php 84
<?php if ( apply_filters( 'woocommerce_shipping_calculator_enable_postcode', true ) ) : ?>

Where the hook is used in WooCommerce

Usage not found.