woocommerce_shipping_calculator( string $button_text = '' )

Output the cart shipping calculator.


Description Description


Parameters Parameters

$button_text

(Optional) Text for the shipping calculation toggle.

Default value: ''


Top ↑

Source Source

File: includes/wc-template-functions.php

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


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.