Guest User

Untitled

a guest
Oct 17th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php
  2.  
  3. add_filter( 'wc_shipment_tracking_get_providers', 'custom_shipment_tracking' );
  4.  
  5. function custom_shipment_tracking( $providers ) {
  6.  
  7. unset($providers['Australia']);
  8. unset($providers['Austria']);
  9. unset($providers['Brazil']);
  10. unset($providers['Belgium']);
  11. unset($providers['Canada']);
  12. unset($providers['Czech Republic']);
  13. unset($providers['Finland']);
  14. unset($providers['France']);
  15. unset($providers['Germany']);
  16. unset($providers['Ireland']);
  17. unset($providers['Italy']);
  18. unset($providers['India']);
  19. unset($providers['Netherlands']);
  20. unset($providers['Romania']);
  21. unset($providers['South African']);
  22. unset($providers['Sweden']);
  23. unset($providers['New Zealand']);
  24. unset($providers['United Kingdom']);
  25. unset($providers['United States']['FedEx Sameday']);
  26. unset($providers['United States']['UPS']);
  27. unset($providers['United States']['OnTrac']);
  28. unset($providers['United States']['DHL US']);
  29.  
  30. return $providers;
  31. }
  32.  
  33. add_filter( 'woocommerce_shipment_tracking_default_provider', 'custom_woocommerce_shipment_tracking_default_provider' );
  34.  
  35. function custom_woocommerce_shipment_tracking_default_provider( $provider ) {
  36. $provider = 'fedex'; // Replace this with the name of the provider. See line 42 in the plugin for the full list.
  37.  
  38. return $provider;
  39. }
Add Comment
Please, Sign In to add comment