WC_Countries::shipping_to_prefix( string $country_code = '' )

Gets the correct string for shipping – either ‘to the’ or ‘to’.


Description Description


Parameters Parameters

$country_code

(Optional) Country code.

Default value: ''


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-wc-countries.php

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

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


Top ↑

User Contributed Notes User Contributed Notes

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