Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shipment Tracking: adds custom provider
/**
* wc_shipment_tracking_add_custom_provider
*
* Adds custom provider to shipment tracking or add existing providers to another country.
*
* Change the country name, the provider name, and the URL (it must include the %1$s)
* Add one provider per line
*/
add_filter( 'wc_shipment_tracking_get_providers' , 'wc_shipment_tracking_add_custom_provider' );
function wc_shipment_tracking_add_custom_provider( $providers ) {
$providers['France']['French New Mail'] = 'https://example.com?id=%1$s'; // add a custom provider
$providers['United Kingdom']['UPS'] = 'https://www.ups.com/track?loc=en_GB&tracknum=%1$s&requester=WT'; // add UPS to the United Kingdom
return $providers;
}
@yaniv691

This comment has been minimized.

Copy link

@yaniv691 yaniv691 commented Jan 16, 2019

How can I set the provider name in a language other than English, e.g. Hebrew or Arabic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment