WC_Countries::shipping_to_prefix()publicWC 1.0

Gets the correct string for shipping - either 'to the' or 'to'.

Method of the class: WC_Countries{}

Return

String.

Usage

$WC_Countries = new WC_Countries();
$WC_Countries->shipping_to_prefix( $country_code );
$country_code(string)
Country code.
Default: ''

WC_Countries::shipping_to_prefix() code WC 9.4.2

public function shipping_to_prefix( $country_code = '' ) {
	$country_code = $country_code ? $country_code : WC()->customer->get_shipping_country();
	$countries    = array( 'AE', 'CZ', 'DO', 'GB', 'NL', 'PH', 'US', 'USAF' );
	$return       = in_array( $country_code, $countries, true ) ? _x( 'to the', 'shipping country prefix', 'woocommerce' ) : _x( 'to', 'shipping country prefix', 'woocommerce' );

	return apply_filters( 'woocommerce_countries_shipping_to_prefix', $return, $country_code );
}