Forked from DustinHartzler/shipment_tracking.php
Last active
October 24, 2017 20:18
-
-
Save Garconis/1f42f944a2b5bfc0b9e37f47a362f255 to your computer and use it in GitHub Desktop.
WooCommerce | Remove options from the Shipment Tracking plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' ); | |
function custom_shipment_tracking( $providers ) { | |
// unset all the ones you don't want (e.g., we kept USPS and FedEx set) | |
unset($providers['Australia']); | |
unset($providers['Austria']); | |
unset($providers['Brazil']); | |
unset($providers['Belgium']); | |
unset($providers['Canada']); | |
unset($providers['Czech Republic']); | |
unset($providers['Finland']); | |
unset($providers['France']); | |
unset($providers['Germany']); | |
unset($providers['Ireland']); | |
unset($providers['Italy']); | |
unset($providers['India']); | |
unset($providers['Netherlands']); | |
unset($providers['Romania']); | |
unset($providers['South African']); | |
unset($providers['Sweden']); | |
unset($providers['New Zealand']); | |
unset($providers['United Kingdom']); | |
unset($providers['United States']['FedEx Sameday']); | |
unset($providers['United States']['UPS']); | |
unset($providers['United States']['OnTrac']); | |
unset($providers['United States']['DHL US']); | |
return $providers; | |
} | |
add_filter( 'woocommerce_shipment_tracking_default_provider', 'custom_woocommerce_shipment_tracking_default_provider' ); | |
// optionally add a Default (pre-selected) provider | |
function custom_woocommerce_shipment_tracking_default_provider( $provider ) { | |
$provider = 'fedex'; // Replace this with the name of the provider. See line 42 in the plugin for the full list. | |
return $provider; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment