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.

Usage

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;
}
$show_postcode(true|false)
Whether to use the postcode field.
Default: true

Changelog

Since 8.4.0 Introduced.

Where the hook is called

WC_Cart::show_shipping()
woocommerce_shipping_calculator_enable_postcode
woocommerce/includes/class-wc-cart.php 1597
$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.