title: Using the WooCommerce API to get the country/state lists
body: <p>I"m using the <a href="https://docs.woothemes.com/wc-apidocs/class-WC_Countries.html" rel="noreferrer">WooCommerce API</a> to get the country list. I am doing:</p>
  
  <pre><code>$woo_countries = new WC_Countries();
  $countries = $woo_countries-&gt;get_allowed_countries();
  </code></pre>
  
  <p>However, how does one get the state list for the default selected country? Also, when the user changes the country, does Woo have something built in that I can apply to the country field to update the states box or do I have to build that functionality myself?</p>
  
  <p>Also, I know I can get the states for a country via doing:</p>
  
  <pre><code>$woo_countries-&gt;get_states(country_code);
  </code></pre>
  
  <p>...but I'm not sure how to get the default selected country to pass in to it?</p>
  
  <p>I also know they have a combined country/state list you can load in but that's really messy and far too long for usability.</p>