woocommerce_shipping_calculator()WC 1.0

Output the cart shipping calculator.

No Hooks.

Return

null. Nothing (null).

Usage

woocommerce_shipping_calculator( $button_text );
$button_text(string)
Text for the shipping calculation toggle.
Default: ''

woocommerce_shipping_calculator() code 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,
		)
	);
}