Help Wordpress

Blog about WordPress, plugins, themplates and more…
MENU
Home » Plugins » WA Edit States List – free WooCommerce plugin

WA Edit States List – free WooCommerce plugin

WA Edit States List

Sometimes it becomes necessary to edit the list of U.S. States on the checkout page. The reasons may be different – for example, store owner not want to deliver your goods in the particular States. Or vice versa – store works only with a few specific U.S. States.

How Add/Modify States in WooCommerce? I know three ways, and I will describe each of them. And you yourself choose the best way.

Add/Modify States List in the translation file.

The list of the States located in /wp-content/plugins/woocommerce/i18n/states/US.php file.
However, note that this decision has a significant drawback – if you will update WooCommerce, you will have to edit this file again.

Add/Modify States List via the code snippet.

Just add in the functions.php file of your theme the following code:

add_filter( 'woocommerce_states', 'custom_woocommerce_states' );

function custom_woocommerce_states( $states ) {

  $states['XX'] = array(
    'XX1' => 'State 1', 
    'XX2' => 'State 2'
  );

  return $states;
}

However, note that this solution is also not without drawbacks:
1 – you will update the template, you will have to re-edit the functions.php;
2 – if you decide to change the template, you have to make changes in functions.php;

Add/Modify States List via free WooCommerce plugin.

I wrote a free plugin for woocommerce. It allows you to turn on and off States in U.S. States list.

WA Edit States List

WA Edit States List

 

WA Edit States List

WA Edit States List

1. Upload the plugin files to the /wp-content/plugins/wa-edit-states directory;
2. Activate the plugin through the ‘Plugins’ screen in WordPress;
3. Use the woocommerce > Edit States List screen and enable or disable states;

Download free WooCommerce plugin.

Posted 1 year ago
Category: Plugins
Tags: , ,

If you like this plugin, please click on one of the buttons to share it with your friends. Thank you!

Related posts:

wordpress-4-7

What’s New in WordPress 4.7

Version 4.7 of WordPress, named “Vaughan” in honor of legendary jazz vocalist Sarah “Sassy” Vaughan, is available for download or update in your WordPress dashboard. New features in [...]
wp-4.6

What’s New in WordPress 4.6

WordPress 4.6 “Pepper” is named in honor of saxophonist Park Frederick “Pepper” Adams III, is available for download or update in your WordPress dashboard. In this version there [...]
Coleman_Hawkins

WP 4.5 – wats new?

Version 4.5 of WordPress, named “Coleman” in honor of jazz saxophonist Coleman Hawkins, was released to the public on April 12, 2016. This is short review of new [...]

1 Comment

1 Comment


RSS feed for comments on this post.

Leave a comment


Last Polls: