Skip to content

Instantly share code, notes, and snippets.

@ChromeOrange
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChromeOrange/bd931a6475cb0d7d5a89 to your computer and use it in GitHub Desktop.
Save ChromeOrange/bd931a6475cb0d7d5a89 to your computer and use it in GitHub Desktop.
Remove USPS Priority Flat Rate envelopes, add to your theme functions.php file
/**
* Remove USPS Flat rate envelopes from the available options
* Once added the customer will not see any rates for envelopes
*/
add_filter( 'usps_flat_rate_boxes', 'custom_usps_flat_rate_boxes' );
function custom_usps_flat_rate_boxes( $flat_rate_boxes ) {
unset($flat_rate_boxes["d29"]);
unset($flat_rate_boxes["d30"]);
unset($flat_rate_boxes["d63"]);
unset($flat_rate_boxes["d16"]);
unset($flat_rate_boxes["d38"]);
unset($flat_rate_boxes["d40"]);
unset($flat_rate_boxes["d42"]);
unset($flat_rate_boxes["d44"]);
unset($flat_rate_boxes["d13"]);
unset($flat_rate_boxes["i33"]);
unset($flat_rate_boxes["i30"]);
unset($flat_rate_boxes["i63"]);
unset($flat_rate_boxes["i8"]);
unset($flat_rate_boxes["i29"]);
return $flat_rate_boxes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment