• Resolved checkmeow

    (@hammouhou)


    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

    (@uriahs-victor)

    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.