Last active
August 2, 2016 12:23
-
-
Save WooForce/53363d90ca7105f99bcfa8184bae7cf5 to your computer and use it in GitHub Desktop.
Hide shipping methods based on destination zipcode
This file contains hidden or 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
add_filter('woocommerce_package_rates', 'wf_remove_shipping_options_for_particular_zip_codes', 10, 2); | |
function wf_remove_shipping_options_for_particular_zip_codes($rates, $package) | |
{ | |
global $woocommerce; | |
$zip_array = array( | |
'30031' | |
); | |
if ( in_array( $woocommerce->customer->get_shipping_postcode() , $zip_array) ) { | |
unset($rates['wf_fedex_woocommerce_shipping:FEDEX_GROUND']); | |
} | |
return $rates; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment