Im beginner for the word press , I don't know if the issue is because of the . The problem is that the "calculate shipping" option on my cart page doesn't allow users to select my country / state list, only allowed postal code

i want to know How to add Woocomrce cart page shipping calculator to my country state list, reason my country state list not here


enter image description here

1 Answer 1


Add this snippet to the functions.php file of your theme to add a new country to the WooCommerce countries list.

add_filter('woocommerce_states', 'sa_woocommerce_states');

function SA_woocommerce_states( $states ) {

    $states['ZA']['EC'] = __('Eastern Cape', 'woocommerce');
    return $states;
  • Hello Sir, whare's to put Dubai > state list
    – core114
    Nov 29, 2018 at 10:34
  • ok i edit code please wait Nov 29, 2018 at 10:36
  • sir, i added this its not working ,selected state option are empty
    – core114
    Nov 29, 2018 at 10:44
  • you add state in code Nov 29, 2018 at 10:47
  • 1
    i am edit code please try Nov 29, 2018 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.