• Resolved ellerish20

    (@ellerish20)


    Hello!

    We are trying to set a Shipping Region to Costa Rica, but we are having a problem. The drop down list only shows one region, but we do believe that there are a total of 2 regions available that we can use and set as our shipping region.

    Is there any way, or a plugin maybe, that can enable us to add our custom shipping regions/zones? Will be much appreciated!

    Thank you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter ellerish20

    (@ellerish20)

    @seank123 thank you very much! problem solved ??

    Hi
    I’m trying to resolve the same issue. Kindly assist or send me your code for me to see how you did it.

    Thanks

    am using woo commerce under shipping zone > Zone regions > it’s showing only one option i.e., Kuwait.

    I am trying to add custom zone regions into the list, to solve this solution I am searching at google search consoles I found one solution but I don’t know how can i edit this code https://docs.woocommerce.com/document/addmodify-states/
    Looking forward to your help

    Can you help me how can i edit the code, please to solve my issues

    /**
    * Add or modify States
    */
    add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );

    function custom_woocommerce_states( $states ) {

    $states[‘XX’] = array(
    ‘XX1’ => ‘State 1’,
    ‘XX2’ => ‘State 2’
    );

    return $states;
    }

    appreciate your support

    Use the country code for Costa Rica – CR:

    
    add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );
    
    function custom_woocommerce_states( $states ) {
    
    $states['CR'] = array(
    'CR1’ => 'State 1',
    'CR2’ => 'State 2'
    );
    
    return $states;
    }
    
    

    Then you can change State 1 and State 2 to the names of the regions you need.

    Great! I was looking for the same feature! Thank you very much

    I added 3 States (they’re regions, in fact) using your snippet:

    /**
     * Adds States
     */
    add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
    
    function custom_woocommerce_states( $states ) {
    
      $states['UY'] = array(
        'UY1' => 'La Barra', 
        'UY2' => 'Punta del Este',
        'UY3' => 'Maldonado'
      );
    
      return $states;
    }

    And I added a couple of shipping methods for each new ‘State’.

    The problem is when selecting the shipping address on the checkout, it doesn’t show the corresponding shipping methods available. E.g. ‘Maldonado’ It only shows the correct shipping methods if I enter ‘UY3’

    I tried changing UY3 for Maldonado too, like this:

      $states['UY'] = array(
        'La Barra' => 'La Barra', 
        'Punta del Este' => 'Punta del Este',
        'Maldonado' => 'Maldonado'

    but it doesn’t work either. I assume that the 2 characters country code is required.

    How can I make it work so the customers could insert the State name for the shipping methods to show?

    Thank you in advance!

    Hi @ellerish20, @kgosi, @gmustafa, @damonh,

    I found “Woo add custom states” plugin which solves the problem, because it takes care of showing the regions everywhere, and can be enabled or disabled anytime. I tested the plugin in the current woocommerce last version and works perfectly.

    You can find the plugin directly if you search it inside plugins section, but the site is https://www.ads-software.com/plugins/woo-add-custom-states/#installation

    Hi everyone,

    I am having nasty shipping zones/zip codes problems!I am trying to build a shipping zones in Lagos state in Nigeria only.

    I have zoned the Lagos state into 4 different regions. but each regions has various cities with different zip codes which i have entered. after setting all these with formula in each region. nothing is working! the error message is like. “There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help”. To make the matter worse. it even make the pick up option to vanish from the checkout page.

    Please i need your help desperately.

    Kind Regards

    I have the same issue. I managed to add custom zones in the list. But the custom zones seem not to work because if i use them to set a shipping zone, that zone will never be found, the Customer matched zone “Locations not covered by your other zones is showing.

    Is there anything else to be done for customised zones to work? Bellow is my hook.
    add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );

    function custom_woocommerce_states( $states ) {

    $states[‘ZW’] = array(
    ‘ZW1’ => ‘Harare’,
    ‘ZW2’ => ‘Avondale’,
    ‘ZW3’ => ‘Gweru’,
    ‘ZW4’ => ‘Kwekwe’,
    ‘ZW5’ => ‘Vic Falls’
    );

    return $states;
    }

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to create custom shipping regions?’ is closed to new replies.