Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save woogists/482a79494f6def6b127326af5057b0d6 to your computer and use it in GitHub Desktop.
Save woogists/482a79494f6def6b127326af5057b0d6 to your computer and use it in GitHub Desktop.
Shipment Tracking: adds custom provider
<?php
add_filter( 'wc_shipment_tracking_get_providers' , 'wc_shipment_tracking_add_custom_provider' );
/**
* wc_shipment_tracking_add_custom_provider
*
* Adds custom provider to shipment tracking
* Change the country name, the provider name, and the URL (it must include the %1$s)
* Add one provider per line
*/
function wc_shipment_tracking_add_custom_provider( $providers ) {
$providers['France']['Provider Name 1'] = 'http://url.com?id=%1$s';
$providers['Ireland']['Provider name 2'] = 'http://url.com?id=%1$s';
// etc...
return $providers;
}
@newcelic
Copy link

FATAL ERROR syntax error, unexpected 'add_filter' (T_STRING) on line number 3

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