When activated the plugin doesn’t show up in Tools.
Has it been moved to another menu, or it is simply not compatible with wordpress any more?
]]>I’m not sure when this started being an issue, but the checkout page will load very slowly when using Microsoft Edge with this plugin active. It seems to be working fine on Google Chrome.
The issue is caused by the huge amount of cities being added to the City Select element in the billing/shipping forms. For Romania, that is about 13000 cities, and it halts the page loading for about 1 minute while it’s creating and adding all those options.
This only happens when there isn’t a county/state already selected. If there is a county/state selected, the City Select element will only contain the cities from the selected county/state, which is fine.
I don’t understand why all the cities need to be added to the Select before the page is even rendered, since the City Select will be disabled until a county/state is selected, at which point the City Select element will be populated with the cities from the wc_city_select_params
javascript object. So we never need all the cities to be present in the select.
My quick fix was to comment the line 147 from wc-city-select.php, which says this:array_walk_recursive( $cities, array( $this, 'add_to_dropdown' ) );
If no city is added to the $this->dropdown_cities
property, no option element has to be created. I’m sure there is a more elegant solution, but I needed something that works, and this works, without breaking the existing functionality.
Hi there! I’m a freelance web developer, and I’m now working on a wordpress project and it is based in Egypt.i downloaded the plugin and its give me the area inside my governorate but can i add different shipping fees to each one of these areas
There are multiple governorates in Egypt each one of them has its own area .I would like to assign a shipping method to the area (zone name). Woocommerce allows me to add the shipping method to the country and limit it with postcode i want instead of the postcode the area name and each area has its own fees.I would like the client to select the governorate after it the area of this governorate will appear with its own fees, such as “ikea” (“https://www.ikea.com/eg/en/cart/”??
Hi there,
I have been unable to get the city select to operate on the checkout page, although it works fine for addresses on the account page.
I have switched themes to Twenty Twenty-Four and the result is the same. Different browsers also don’t seem to make any difference.
Is there perhaps a compatibility issue, or are you able to offer any advice as to why it isn’t operating?
Thank you.
]]>Hello, I am testing FunnelKit and I noticed that the City field is not being replaced by the dropdown. Can you please help?
]]>any update in order to be compatible with woocommerce hpos?
]]>Hello 8manos Team,
I really appreciate your efforts developing this plugin! it really saves a lot of time and standardize a very frequent task ?
I found a small mistake in the Egyptian cities in EG.php
from lines 218 to 253. Where EGKB
is being set two times. The second one should be EGDK
which is Dakahlia Governorate.
I have already fixed this problem on my websites, I wish you can push this fix so other plugin users benefit from it.
'EGKB' => array(
'Abu Zaabal',
'Al Khanka',
'Al Shareaa Al Gadid',
'Bahteem',
'Banha',
'El Kanater EL Khayrya',
'El Khsos',
'El Oboor',
'El Qalag',
'Kafr Shokr',
'Meet Nama',
'Mostorod',
'Om Bayoumi',
'Orabi',
'Qaha',
'Qalyoob',
'Qalyubia',
'Sheben Alkanater',
'Shoubra Alkhema',
'Tookh'
),
'EGKB' => array( # should be fixed to EGDK
'Aga',
'Al Daqahliya',
'Al Mansoura',
'Belqas',
'Dekernes',
'El Sinblaween',
'Manzala',
'Meet Ghamr',
'Menit El Nasr',
'Nabroo',
'Shrbeen',
'Talkha'
),
Thank You!
]]>Hello,
How can I display only one city in the dropdown for the state/county “Dolj”?
For all the other counties/states I need the complete list, only for the one above I need to remove/hide all the other cities except “Craiova”.
Thank you!
]]>Hey 8manos, great plugin.
How to make city dropdown searchable?
data-live-search=”true”
Thanks
]]>Hi,
Thanks for the wonderful plugin, it works fine with other themes!
However, Facing an issue with Flatsome theme.
Have to refresh the checkout page to change the city list for a particular state.
Hope there is a fix soon
Thanks in advance
]]>Can you please advise how to use these cities as shipping zones as well?
Thanks!
]]>hi, this plugin saved me a lot of time, i am really thankful for your work.
and i was wondering is there is a documentation.
for applying the city dropdown to the shipping calculator and to the registration and address in the profile.
Thank you.
]]>Hi! Great plugin!
Is it possible to set default city from the list for selected country?
Now “Select an option” is displayed by default.
I try to use this function but it make no effect to me.
add_filter( ‘woocommerce_checkout_fields’, ‘set_checkout_field_input_value_default’ );
function set_checkout_field_input_value_default($fields) {
$fields[‘billing’][‘billing_city’][‘default’] = ‘Default City’;
return $fields;
}
Hi.
Is there a way to add districts or provinces to the cities?
I need it like this Turkey > Bursa > Nilüfer > Altinsehir > X Street
Can this be done?
]]>The current Plugin as is dose not support translating the city names to multiple languages.
I made the following changes to fix that:
1- When preparing the cities:
function my_cities( $cities ) {
$cities['XX'] = array(
'YYY' => array(
['City in English'] => __('City in English','city_names'),
['Another City in English'] => __('Another City in English','city_names')
),
'ZZZ' => array(
['City3 in English'] => __('City3 in English','city_names'),
['City4 in English'] => __('City4 in English','city_names')
)
);
return $cities;
}
2- in the php:
foreach ( $this->dropdown_cities as $city_code => $city_name ) {
$field .= '<option value="' . esc_attr( $city_code ) . '" '.selected( $value, $city_code, false ) . '>' . $city_name .'</option>';
}
1- in the java:
options = options + '<option value="' + index + '">' + cityName + '</option>';
The current Plugin as is dose not support translating the city names to multiple languages.
I made the following changes to fix that:
1- When preparing the cities:
function my_cities( $cities ) {
$cities[‘XX’] = array(
‘YYY’ => array(
[‘City in English’] => __(‘City in English’,’city_names’),
[‘Another City in English’] => __(‘Another City in English’,’city_names’)
),
‘ZZZ’ => array(
[‘City3 in English’] => __(‘City3 in English’,’city_names’),
[‘City4 in English’] => __(‘City4 in English’,’city_names’)
)
);
return $cities;
}
2- in the php:
foreach ( $this->dropdown_cities as $city_code => $city_name ) {
$field .= ‘<option value=”‘ . esc_attr( $city_code ) . ‘” ‘.selected( $value, $city_code, false ) . ‘>’ . $city_name .'</option>’;
}
1- in the java:
options = options + ‘<option value=”‘ + index + ‘”>’ + cityName + ‘</option>’;
I have added the code through Snippet, but the dropdown section from the checkout page doesn’t work. It seems doesn’t come with the city I add in the function.php file. Below is the code I have with WC select city, can you kindly let me know what the issue is:
<?php
add_filter( ‘wc_city_select_cities’, ‘my_cities’ );
/**
* Replace XX with the country code. Instead of YYY, ZZZ use actual state codes.
*/
function my_cities( $cities ) {
$cities[‘CL’] = array(
‘Metropolitana de Santiago’ => array(
‘Provincia de Chacabuco’,
‘Provincia de Cordillera’,
‘Provincia de Santiago’
),
);
return $cities;
}
add_filter( ‘wc_city_select_cities’, ‘my_cities’ );
/**
* Replace XX with the country code. Instead of YYY, ZZZ use actual state codes.
*/
function my_cities( $cities ) {
$cities[‘NP’] = array(
‘SET’ => array(
‘Dhangadhi- Adarsha Tole Area’,
‘Dhangadhi- Badhara Area’,
‘Dhangadhi- Baiya Behandi’,
‘Dhangadhi- Bishalnagar Area’,
‘Dhangadhi- Campus Road Area’,
‘Dhangadhi- Chatakpur Area’,
‘Dhangadhi- Chauraha Area’,
‘Dhangadhi- Hasanpur Area’,
‘Dhangadhi- Jai Area’,
‘Dhangadhi- Kailali District Court Area’,
‘Dhangadhi- Om Shanti Tole’,
‘Dhangadhi- Santoshi Tole Area’,
‘Dhangadhi- Taranagar Area’,
‘Dhangadhi- Uttar Behandi’,
),
‘JAN’ => array(
‘Janakpur- Adarsh Nagar’,
‘Janakpur- Balmiki Nagar’,
‘Janakpur- Brahmapura Chowk’,
‘Janakpur- Cigarette Factory Area’,
‘Janakpur- Hanuman Nagar’,
‘Janakpur- Janaki Mandir Area’,
‘Janakpur- Janakpur Airport Area’,
‘Janakpur- Kishori Nagar’,
‘Janakpur- Mills Area’,
‘Janakpur- Mujelia Area’,
‘Janakpur- Murali Chowk’,
‘Janakpur- Pidari Chowk’,
‘Janakpur- Pulchowk’,
‘Janakpur- Ramanand Chowk’,
‘Janakpur- Ram Chowk’,
‘Janakpur- Wakil Tole’,
‘Janakpur- Zero Mile’
),
‘BHE’ => array(
‘Nepalgunj- Adrash Nagar Area’,
‘Nepalgunj- Basudevpur Area’,
‘Nepalgunj- Belaspur Area’,
‘Nepalgunj- Bhawanipur Area’,
‘Nepalgunj- BP Chowk Area’,
‘Nepalgunj- Dhamboji Area’,
‘Nepalgunj- Indrapur Area’,
‘Nepalgunj- Jaisapur Area’,
‘Nepalgunj- Khaskarkado Area’,
‘Nepalgunj- Manikapur Area’,
‘Nepalgunj- Prasapur Area’,
‘Nepalgunj- Puraina Area’,
‘Nepalgunj- Udayapur Area’,
‘Surkhet- Army Camp Area’,
‘Surkhet- Dhuliyabit Area’,
‘Surkhet- Kakrebihar Area’,
‘Surkhet- Mangalgadhi Chowk Area’,
‘Surkhet- Radio Nepal Area’,
‘Surkhet- Surkhet Hospital Area’,
‘Surkhet- Uttarganga Area’,
),
);
return $cities;
}
I have added custom cities in the function.php file.The cities are not getting updated automatically on change of states in real time.Need to refresh the page everytime to update the state for their respective city.Kindly help.
]]>I added the code below but still, the city drop-down is empty
add_filter( ‘wcfmmp_city_select_dropdown_enabled’, ‘__return_true’ );
add_filter( ‘wc_city_select_cities’, ‘my_cities’ );
function my_cities( $cities ) {
$cities[‘zw’] = array(
‘Harare’,
‘Chitungwiza’,
‘Norton’,
‘Kadoma’,
‘Chegutu’,
‘Kwekwe’,
‘Gweru’,
‘Bulawayo’,
‘Mutare’,
‘Epworth’,
‘Chinhoyi’,
‘Marondera’,
‘Ruwa’,
‘Zvishavane’,
‘Bindura’
);
return $cities;
}
What I am searching for is the following.
When someones enables a shipping address I want the billing city field to be default woocommerce, so thatyou can type in anything you want.
is this possible ?
]]>Hi,
Plugin works fine thank you. But when I open the error report it gives these warnings;
[02-Sep-2020 12:02:56 UTC] PHP Notice: Array to string conversion in /home/public_html/wp-content/plugins/wc-city-select/wc-city-select.php on line 142
[02-Sep-2020 12:02:56 UTC] PHP Notice: Array to string conversion in /home/public_html/wp-includes/formatting.php on line 1098
[02-Sep-2020 12:02:56 UTC] PHP Notice: Array to string conversion in /home/public_html/wp-includes/general-template.php on line 4838
WordPress version 5.5.1
WooCommerce version 4.4.1
When i select a state it shows whole list city from every state
]]>Hi. the plugin shows a lot of the word “array” when you haven’t selected a country. how can we fix this? thanks screenshot >> https://snag.gy/zZRqon.jpg
]]>Can you help me about Wc City Select, how to change the code that the option value of city will be not the option name. like the country and state thats have own option value code.
Thank You in advance.,Please help me.
Hello,
How to remove searchable cities from the dropdown
Thanks
]]>Hi !
I want to use this plugin to limit cities to send my products.
Is it possible to match cities to shipping costs ?
I mean:
1) New York -> 10$
2) Moscow -> 40$
3) … etc.
I hope you understand.
Thanks for help.
]]>Does anyone know how to do dropdown on cities in creating a new order from admin wordpress. I mention that we have implemented the dropdown plugin on the checkout page and it works.
]]>Hi,
Tamil Nadu is my default state, but when I select any new state, a dropdown of the city field disappears.
Need to refresh a page every time I select new state.
Please help to find the solution.
]]>Hi there!
Hope you are well.
Quick question – is this plugin compatible with WooCommerce 3.2.6? Here’s the status I get from WooCommerce: https://imgur.com/a/VEdmV
Just asking because I am working with a slightly fragile environment and so testing myself can easily end up causing problems that are hard to rectify, and if you already know whether it is compatible, then it would be good to know! ??
Many thanks!
]]>I have coded with the following script so that it could be able to find the string translation under WPML. However, it doesn’t like generic woocommerce_states, the cities cannot be translated accounting to the theme language. It stores the translated value instead of the original value into the SQL.
Would you please advise how to fix it?
2nd question is it doesn’t read the SQL while user trying to edit the address in MYACCOUNT.
===
function my_cities( $cities ) {
$cities[‘HK’] = array(
‘KOWLOON’ => array(
__(‘Cheung Sha Wan’),
__(‘Choi Hung’),
===
===
add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );
function custom_woocommerce_states( $states ) {
$states[‘HK’] = array(
‘HONG KONG’ => __(‘HONG KONG’),
‘KOWLOON’ => __(‘KOWLOON’),
‘NEW TERRITORIES’ => __(‘NEW TERRITORIES’),
‘OUTLYING ISLAND’ => __(‘OUTLYING ISLAND’),
);
return $states;
}
===