• Resolved profarnsworth

    (@profarnsworth)


    In the address book, 99% of my customers are from the USA. I would like to set that as the default in the country field. How do I go about that. I am familiar with adding code to the functions.php it that is what is needed.
    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matt Harrison

    (@matt-h-1)

    That is a good question.

    The Address Book plugin doesn’t handle anything about the actual address fields used by WooCommerce, so to do this would require adding some kind of filter to WooCommerce.

    Without the Address Book plugin the “Default customer location” setting in the WooCommerce settings allows the default to be set but it looks like it only defaults to that on the checkout and not in the edit Billing Address or Shipping Address fields.

    So, with the Address Book plugin it uses the same address field setup as Core WooCommerce when adding new addresses.

    I did do a brief search and didn’t find any obvious ways to set this so if someone is able to answer how to modify it to do this that would be useful, but setting this is currently outside the scope of this plugin.

    Plugin Contributor TimBHowe

    (@timbhowe)

    This is something you would setting in WooCommerce Core.

    1. It can be done by “Default customer location” in the WooCommerce > Settings > General options.
    https://woocommerce.com/document/configuring-woocommerce-settings/#store-address

    Defines your shop’s address country and state, where you are based as a seller. It determines default tax rates and customer locations.
    Default Customer Address choose the location we assume site visitors are in, before they enter it, to calculate tax and shipping.

    2. Or you can use this WooCommerce hook to set it in the functions.php file of your theme
    https://woocommerce.com/document/change-the-default-state-and-country-on-the-checkout/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to set default country’ is closed to new replies.