Automattic\WooCommerce\Admin\Features\Fulfillments\Providers
DHLShippingProvider::can_ship_from_to
Checks if DHL can ship between two countries.
Метод класса: DHLShippingProvider{}
Хуков нет.
Возвращает
bool. True if shipping route is supported.
Использование
$DHLShippingProvider = new DHLShippingProvider(); $DHLShippingProvider->can_ship_from_to( $shipping_from, $shipping_to ): bool;
- $shipping_from(строка) (обязательный)
- Origin country code.
- $shipping_to(строка) (обязательный)
- Destination country code.
Код DHLShippingProvider::can_ship_from_to() DHLShippingProvider::can ship from to WC 11.2.1
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 );
}