Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set the WooCommerce store city and zipcode / postcode
/**
* Set the store base city and postcode / zipcode
*/
add_filter( 'woocommerce_countries_base_city' , 'set_woocommerce_countries_base_city' );
function set_woocommerce_countries_base_city() {
// Replace with your store town/city
return 'Townland';
}
add_filter( 'woocommerce_countries_base_postcode' , 'set_woocommerce_countries_base_postcode' );
function set_woocommerce_countries_base_postcode() {
// Replace with your store postcode / zipcode
return '45040';
}
@dacampbe

This comment has been minimized.

Copy link

@dacampbe dacampbe commented Jun 20, 2014

What file do I place this in?

@ChromeOrange

This comment has been minimized.

Copy link
Owner Author

@ChromeOrange ChromeOrange commented Jun 20, 2014

Your theme functions.php file

@ofernandolopes

This comment has been minimized.

Copy link

@ofernandolopes ofernandolopes commented May 23, 2015

How do I configure more than one postcode at the same time? Just duplicate the code or do I postcodes separated by commas?

@ChromeOrange

This comment has been minimized.

Copy link
Owner Author

@ChromeOrange ChromeOrange commented Jun 2, 2015

@ofernandolpes you can't, WooCommerce only supports one store address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment