Title: State code and google API
Last modified: March 11, 2024

---

# State code and google API

 *  Resolved [checkmeow](https://wordpress.org/support/users/hammouhou/)
 * (@hammouhou)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/state-code-and-google-api/)
 * Hello,
 * First thank you for this great plugin.
 * I am having an issue where google state short_name does not match woocommerce
   state shortnames.
 * I have tried editing the woocomerce states by replacing all the states with the
   code:
 * add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );
   function custom_woocommerce_states(
   $states ) {$states[‘COUNTRY CODE’] = array(
 * ‘google state short code’ => ‘state name’,
 * And it works for auto state detection using your plugin!
 * The problem I face with this method is that the shipping zones in Dokan do not
   work with the created custome states.
 * Is there an other way to fix the issue?
 * Thanks,

Viewing 1 replies (of 1 total)

 *  Plugin Author [Uriahs Victor](https://wordpress.org/support/users/uriahs-victor/)
 * (@uriahs-victor)
 * [2 years, 2 months ago](https://wordpress.org/support/topic/state-code-and-google-api/#post-17497687)
 * Hi there, unfortunately there’s no real way to get around this currently as the
   details sent back by Google aren’t always what WooCommerce expects. Thats why
   you had to manually set the country codes using that filter.
   You need to either
   ask dokan how to get custom states to work, or simply let users manually select
   their state. You would still have their GPS location, its just that they’d have
   to manually select a field…

Viewing 1 replies (of 1 total)

The topic ‘State code and google API’ is closed to new replies.

 * ![](https://ps.w.org/map-location-picker-at-checkout-for-woocommerce/assets/icon-
   256x256.png?rev=2876264)
 * [Kikote - Location Picker at Checkout & Google Address AutoFill Plugin for WooCommerce](https://wordpress.org/plugins/map-location-picker-at-checkout-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/map-location-picker-at-checkout-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/map-location-picker-at-checkout-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/map-location-picker-at-checkout-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/map-location-picker-at-checkout-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/map-location-picker-at-checkout-for-woocommerce/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Uriahs Victor](https://wordpress.org/support/users/uriahs-victor/)
 * Last activity: [2 years, 2 months ago](https://wordpress.org/support/topic/state-code-and-google-api/#post-17497687)
 * Status: resolved