• Resolved WorkinWP

    (@iguanamom)


    Hi,

    I did search and try this solution in my child’s functions.php file on the staging site, but it didn’t do anything:

    add_filter('woocommerce_get_country_locale', 'custom_nz_locale');
    function custom_nz_locale($locale){
      $locale['NZ']['state']['required'] = true;
      return $locale;
    }

    Maybe the labels have changed by now (that was 2018). I have made NZ the only country we ship to, however we had an order from outside of NZ which slipped through somehow. I figure requiring the Region will solve that to some extent. They obviously ignored the fact that we only send to NZ. If you can think of a better way, I’m all ears.

    In the meantime, how can I require Region (says ‘state’ in the code which isn’t the label used in checkout)? I tried replacing it with ‘region’ instead and it didn’t make a difference.

    Thank you!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Require region for NZ’ is closed to new replies.