Created
May 12, 2020 22:53
-
-
Save ofernandolopes/1c9e404d3313a849058beabaf7b14c44 to your computer and use it in GitHub Desktop.
WooCommerce set default city on checkout
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
/** | |
* @snippet WooCommerce Set Default City @ Checkout | |
* @how-to Get CustomizeWoo.com FREE | |
* @sourcecode https://businessbloomer.com/?p=21223 | |
* @author Rodolfo Melogli | |
* @testedwith WooCommerce 3.4.6 | |
*/ | |
add_filter( 'woocommerce_checkout_fields', 'bbloomer_set_checkout_field_input_value_default' ); | |
function bbloomer_set_checkout_field_input_value_default($fields) { | |
$fields['billing']['billing_city']['default'] = 'London'; | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment