We include a fairly comprehensive list of the most popular shipping providers for your vendors to add tracking numbers on the Pro Dashboard > Orders > Tracking Number section. Sometimes you might want to replace them all with your own list, or add one we don’t have in there. This is the code to do just that.
Option #1 — Add additional providers to the list of what we already include with Pro. This will simply add more shipping providers, and keep the ones that are already there.
/* WC Vendors Pro replace shipping providers with custom list */ function custom_shipping_providers( $providers ){ $providers[ 'Country' ] = array( 'Shipping Company #1' => 'http://their-website-for-tracking.com/%1$s', 'Shipping Company #2' => 'https://another-website-for-tracking.com/?tracking=%1$s', ); return $providers; } add_filter( 'wcv_shipping_providers_list', 'custom_shipping_providers' );
Option #2 — REPLACE all shipping providers, and use your custom list of them. This will remove all shipping providers that come with Pro, and replace them only with the ones you code below:
/* WC Vendors Pro add custom shipping providers */ /* Note: Replace 'Shipping Providers:' with whatever title you want it to display as. Leave as is otherwise. */ function custom_shipping_providers( $providers ){ $providers = array( 'Shipping Providers:' => array( // Change Your Title to something else 'Shipping Company #1' => 'http://their-website-for-tracking.com/%1$s', 'Shipping Company #2' => 'https://another-website-for-tracking.com/?tracking=%1$s', )); return $providers; } add_filter( 'wcv_shipping_providers_list', 'custom_shipping_providers' );