woocommerce_shipping_calculator()WC 1.0

Output the cart shipping calculator.

Хуков нет.

Возвращает

null. Ничего (null).

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

woocommerce_shipping_calculator( $button_text );
$button_text(строка)
Text for the shipping calculation toggle.
По умолчанию: ''

Код woocommerce_shipping_calculator() WC 8.7.0

function woocommerce_shipping_calculator( $button_text = '' ) {
	if ( 'no' === get_option( 'woocommerce_enable_shipping_calc' ) || ! WC()->cart->needs_shipping() ) {
		return;
	}
	wp_enqueue_script( 'wc-country-select' );
	wc_get_template(
		'cart/shipping-calculator.php',
		array(
			'button_text' => $button_text,
		)
	);
}