John:
Thank you for your response.. Please do keep me posted on your updated plugin.
I am sure you are aware of this (I am a potter not a coder). But I have been messing about with this issue for a bit now and have figured some things out.. The current WC does not have the individual US states listed so users will have to enter them manually. This is not a huge deal I did use this line that I added to my child-themes functions.php:
/**
* Code goes in functions.php or a custom plugin. Replace XX with the country code your changing.
*/
add_filter( ‘woocommerce_states’, ‘custom_woocommerce_states’ );
function custom_woocommerce_states( $states ) {
$states[‘US’] = array(
‘US1’ => ‘Alabama ‘,
‘US2’ => ‘Alaska ‘
*if anyone wants to try this make note of the number after US. This is critical or WC will only show you the very last entry in the list and you WILL have to enter all the states written before, yes I did that…maybe twice, Im not telling:)
I do prefer this as opposed to having another plugin to maintain… Will your plugin have this ability to enter the states? Also, as I have found out, even after the states are entered into the child-theme/functions.php the other plugins that claim they can sort by states this is where they fail. Not sure if it is a WC issue or that the plugin is not querying the info correctly but after extensive trial and error I could not get them to work efficiently. My work around was to create 50 new “countries” then listing those “countries” individually in the WC settings that enables WC/Plugin to find each other. I hope you have better luck with that… Good luck and thanks!
Cheers,
Sean