Automattic\WooCommerce\Internal\Fulfillments\Providers

AbstractShippingProvider::try_parse_tracking_numberpublicWC 1.0

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

Method of the class: AbstractShippingProvider{}

No Hooks.

Returns

Array|null. The tracking URL with ambiguity score, or null if parsing fails.

phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter

Usage

$AbstractShippingProvider = new AbstractShippingProvider();
$AbstractShippingProvider->try_parse_tracking_number( $tracking_number, $shipping_from, $shipping_to ): ?array;
$tracking_number(string) (required)
The tracking number.
$shipping_from(string) (required)
The country code from which the shipment is sent.
$shipping_to(string) (required)
The country code to which the shipment is sent.

AbstractShippingProvider::try_parse_tracking_number() code WC 10.3.3

public function try_parse_tracking_number( string $tracking_number, string $shipping_from, string $shipping_to ): ?array {
	return null; // Default implementation returns null, subclasses should override this method.
}