• Hi,

    What is the code to add to the functions file to limit this to one specific country?

    Assistance would be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Need it also.

    You can add something like this to functions

    /*—–Limit State Dropdowns to One State—*/
    // Only one state e.g. NV in US
    add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );
    function custom_woocommerce_states( $states ) {
    $states[‘US’] = array(
    ‘NV’ => ‘Nevada’,
    );
    return $states;
    }

    Thread Starter ggrrraaaa12345

    (@ggrrraaaa12345)

    How about for 1 country only?

    Contacted the developer, they want to charge $140 per hour to customise it even though it is just 2-3 lines of code…

    Thanks for the help!

    Plugin Contributor natekinkead

    (@natekinkead)

    Hi everyone. I’m trying to figure out why you’re having an issue with limiting it to one country. The address autocomplete uses the country that is set on the checkout country field. If you want to limit it to one country, then just limit the WooCommerce store to one country. I tested it out myself and it seems to be working fine.

    If I’m missing something, please let me know.

    FYI, I just released an update that fixes some other issues, so please give it a try.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘What is the code to limit to 1 country?’ is closed to new replies.