Created
June 20, 2016 06:55
-
-
Save harisrozak/9b5250ce131071662e0b6385bf98c23a to your computer and use it in GitHub Desktop.
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
<?php | |
// set some checkout fields to empty | |
add_filter('woocommerce_checkout_get_value','woo_ongkir_checkout_get_value', 10, 2); | |
function woo_ongkir_checkout_get_value($default, $field) | |
{ | |
$empty_fields = array( | |
'billing_postcode', | |
'billing_state', | |
'billing_city', | |
'billing_district', | |
'shipping_postcode', | |
'shipping_state', | |
'shipping_city', | |
'shipping_district' | |
); | |
if(in_array($field, $empty_fields)) { | |
return ""; | |
} | |
else { | |
return $default; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment