Automattic\WooCommerce\Internal\Fulfillments\Providers

AbstractShippingProvider::can_ship_topublicWC 1.0

Check if the shipping provider can ship to a specific country.

Method of the class: AbstractShippingProvider{}

No Hooks.

Returns

true|false. True if the provider can ship to the country, false otherwise.

Usage

$AbstractShippingProvider = new AbstractShippingProvider();
$AbstractShippingProvider->can_ship_to( $country_code ): bool;
$country_code(string) (required)
The country code to check.

AbstractShippingProvider::can_ship_to() code WC 10.3.3

public function can_ship_to( string $country_code ): bool {
	return in_array( $country_code, $this->get_shipping_to_countries(), true );
}