WooCommerce Code Reference

AmazonLogisticsShippingProvider extends AbstractShippingProvider
in package

Amazon Logistics Shipping Provider implementation.

Handles Amazon Logistics tracking number detection and validation.

Table of Contents

$operating_countries  : array<string|int, mixed>
Countries where Amazon Logistics operates.
can_ship_from()  : bool
Check if the shipping provider can ship from a specific country.
can_ship_from_to()  : bool
Checks if Amazon Logistics can ship between two countries.
can_ship_to()  : bool
Check if the shipping provider can ship to a specific country.
get_icon()  : string
Gets the path to the provider's icon.
get_key()  : string
Gets the unique provider key.
get_name()  : string
Gets the display name of the provider.
get_shipping_from_countries()  : array<string|int, string>
Gets the list of origin countries supported by Amazon Logistics.
get_shipping_to_countries()  : array<string|int, string>
Gets the list of destination countries supported by Amazon Logistics.
get_tracking_url()  : string
Generates the tracking URL for an Amazon Logistics tracking number.
try_parse_tracking_number()  : array<string|int, mixed>|null
Validates and parses an Amazon Logistics tracking number.

Properties

$operating_countries

Countries where Amazon Logistics operates.

private array<string|int, mixed> $operating_countries = array('US', 'CA', 'GB', 'DE', 'FR', 'BE', 'NL', 'IT', 'IN', 'MX', 'JP', 'AU', 'ES', 'CN', 'HK', 'SG', 'GG', 'JE', 'IM', 'GI', 'AT', 'CH', 'PL', 'SE', 'DK', 'NO', 'FI', 'IE', 'PT', 'CZ', 'HU', 'RO', 'BG', 'HR', 'SK', 'SI', 'EE', 'LV', 'LT', 'CY', 'MT', 'LU', 'GR', 'BR', 'TR', 'AE', 'SA', 'EG', 'KW', 'IL', 'ZA', 'KR', 'TW', 'TH', 'MY', 'ID', 'PH', 'VN', 'NZ')

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()

Checks if Amazon Logistics can ship between two countries.

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

Origin country code.

$shipping_to : string

Destination country code.

Return values
boolTrue if shipping route is supported.

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()

Validates and parses an Amazon Logistics tracking number.

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 to validate.

$shipping_from : string

Origin country code.

$shipping_to : string

Destination country code.

Return values
array<string|int, mixed>|nullArray with tracking URL and score, or null if invalid.