Support » Plugin: WooCommerce » How to add my own values in State/County field

  • Resolved TechMan

    (@techman)


    Is it possible to add my own values in State/County field?
    Right now it is displaying 8 Pakistani territories “Azad Kashmir, Balochistan, FATA, GB, Islamabad, KPK, Punjab, Sindh but I want to display cities instead.

    Tried following code but it doesn’t do anything and WooCommerce still displays those 8 territories.

    add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
    
    function custom_woocommerce_states( $states ) {
    
      $states['92'] = array(
        '921' => 'Karachi', 
        '922' => 'Lahore'
      );
    
      return $states;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add my own values in State/County field’ is closed to new replies.