WooCommerce Code Reference

SlovenskaPostaShippingProvider extends AbstractShippingProvider
in package

Slovenska Posta Shipping Provider class.

Table of Contents

can_ship_from()  : bool
Check if the shipping provider can ship from a specific country.
can_ship_from_to()  : bool
Check if the shipping provider can ship from a specific country to another.
can_ship_to()  : bool
Check if the shipping provider can ship to a specific country.
get_icon()  : string
Get the icon of the shipping provider.
get_key()  : string
Get the key of the shipping provider.
get_name()  : string
Get the name of the shipping provider.
get_shipping_from_countries()  : array<string|int, mixed>
Get the countries from which the shipping provider can ship.
get_shipping_to_countries()  : array<string|int, mixed>
Get the countries to which the shipping provider can ship.
get_tracking_url()  : string
Get the tracking URL for a given tracking number.
try_parse_tracking_number()  : array<string|int, mixed>|null
Get the tracking URL for a given tracking number with additional parameters.

Methods

can_ship_from()

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

public can_ship_from(string $country_code) : bool
Parameters
$country_code : string

The country code to check.

Return values
boolTrue if the provider can ship from the country, false otherwise.

can_ship_from_to()

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

public can_ship_from_to(string $shipping_from, string $shipping_to) : bool
Parameters
$shipping_from : string

The country code from which the shipment is sent.

$shipping_to : string

The country code to which the shipment is sent.

Return values
boolTrue if the provider can ship from the source to the destination, false otherwise.

can_ship_to()

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

public can_ship_to(string $country_code) : bool
Parameters
$country_code : string

The country code to check.

Return values
boolTrue if the provider can ship to the country, false otherwise.

try_parse_tracking_number()

Get the tracking URL for a given tracking number with additional parameters.

public try_parse_tracking_number(string $tracking_number, string $shipping_from, string $shipping_to) : array<string|int, mixed>|null
Parameters
$tracking_number : string

The tracking number.

$shipping_from : string

The country code from which the shipment is sent.

$shipping_to : string

The country code to which the shipment is sent.

Return values
array<string|int, mixed>|nullThe tracking URL with ambiguity score, or null if parsing fails. phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter