Closed abedfatafta closed 8 years ago
I've added some instructions, hopefully it's clear now
If i add the filter in the functiuons.php the drop down is not working anymore.
Also, don't know why, if i use your strucutre, and copy the code from the citi file in functions php, the dropdown is not showing :(
@cristianciuberea can you share your code to see if there's something wrong?
sure, attached. thanks for help romanian_cities.txt
@cristianciuberea it looks ok. did you add your country's states using woocommerce_states filter?
Yes, this is the code:
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) { $states['RO'] = array( 'AB' => 'Alba', 'AR' => 'Arad', 'AG' => 'Arges', 'BC' => 'Bacau', 'BH' => 'Bihor', 'BN' => 'Bistrita-Nasaud', 'BT' => 'Botosani', 'BV' => 'Brasov', 'BR' => 'Braila', 'B' => 'Bucuresti', 'BZ' => 'Buzau', 'CS' => 'Caras-Severin', 'CL' => 'Calarasi', 'CJ' => 'Cluj', 'CT' => 'Constanta', 'CV' => 'Covasna', 'DB' => 'Dambovita', 'DJ' => 'Dolj', 'GL' => 'Galati', 'GR' => 'Giurgiu', 'GJ' => 'Gorj', 'HR' => 'Harghita', 'HD' => 'Hunedoara', 'IL' => 'Ialomita', 'IS' => 'Iasi', 'IF' => 'Ilfov', 'MM' => 'Maramures', 'MH' => 'Mehedinti', 'MS' => 'Mures', 'NT' => 'Neamt', 'OT' => 'Olt', 'PH' => 'Prahova', 'SM' => 'Satu Mare', 'SJ' => 'Salaj', 'SB' => 'Sibiu', 'SV' => 'Suceava', 'TR' => 'Teleorman', 'TM' => 'Timis', 'TL' => 'Tulcea', 'VS' => 'Vaslui', 'VL' => 'Valcea', 'VN' => 'Vrancea' );
return $states; }
it should be working. Is your site online so I can see it?
This is a test version http://myplayground.website/product/carte/. The Dropdown for cities doesnt work if i add that code in the functions only if i use the plugin
are you sure the plugin is installed and active?
Do i need to have them both? the code with cities in functionts, and the plugin activated?
The idea is that the plugin is active, the delivery doesnt work ok. The cities are not recognized in the delivery sistem. So i wanted to try with code only, without plugin.
Can i do this? or the code in the romanian_cities.txt file work only with plugin activated?
Thanks for help
The plugin has to be active. That's what makes it all work. I guess you'd have to check your delivery system. The only change made to the form is that the cities input is replaced for a select.
Dear, after installaing , where and how to apply the filter ? could you please specify