Skip to content

Instantly share code, notes, and snippets.

@ofernandolopes
Created May 12, 2020 22:53
Show Gist options
  • Save ofernandolopes/1c9e404d3313a849058beabaf7b14c44 to your computer and use it in GitHub Desktop.
Save ofernandolopes/1c9e404d3313a849058beabaf7b14c44 to your computer and use it in GitHub Desktop.
WooCommerce set default city on checkout
/**
* @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