Automattic\WooCommerce\Internal\Fulfillments\Providers
USPSShippingProvider::can_ship_from_to
Checks if USPS can ship from and to the specified countries.
Method of the class: USPSShippingProvider{}
No Hooks.
Returns
true|false.
Usage
$USPSShippingProvider = new USPSShippingProvider(); $USPSShippingProvider->can_ship_from_to( $shipping_from, $shipping_to ): bool;
- $shipping_from(string) (required)
- Origin country code.
- $shipping_to(string) (required)
- Destination country code.
USPSShippingProvider::can_ship_from_to() USPSShippingProvider::can ship from to code WC 10.3.3
public function can_ship_from_to( string $shipping_from, string $shipping_to ): bool {
return in_array( $shipping_from, $this->get_shipping_from_countries(), true )
&& in_array( $shipping_to, $this->get_shipping_to_countries(), true );
}