woocommerce_shipping_calculator_enable_postcode хук-фильтрWC 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;
}
$show_postcode(true|false)
Whether to use the postcode field.
По умолчанию: true

Список изменений

С версии 8.4.0 Введена.

Где вызывается хук

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 ) ) : ?>

Где используется хук в WooCommerce

Использование не найдено.