WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Remove a Particular State/County from Shipping or Billing Form (5 posts)

  1. peted172
    Member
    Posted 1 year ago #

    Is there any way of Removing a Particular State/County from Shipping or Billing Form, my customer only ships to specific suburbs in the Melbourne metro area and does not ship to other States. Can they be removed? Which file do i edit?

    http://wordpress.org/extend/plugins/woocommerce/

  2. peted172
    Member
    Posted 1 year ago #

    Found it...

    You edit the class-wc-countries.php file which sits in plugins/woocommerce/classes

  3. DeeperLook
    Member
    Posted 9 months ago #

    Hi Peted172,

    I'm in need of a similar solution! I need my store to exclude shipping to NT, WA and TAS.

    Where exactly did you remove the States in the class-wc-countries.php file?

    Thanks Mate!

  4. peted172
    Member
    Posted 9 months ago #

    Hi Deeperlook

    Line 282

    $this->states = apply_filters('woocommerce_states', array(
    'AU' => array(
    'VIC' => __('Victoria', 'woocommerce') ,

    I just deleted all the states the were not required, you have to remember to do this each time you update Woocommerce

    Cheers Pete

  5. peted172
    Member
    Posted 9 months ago #

    Hi Deeperlook

    Just updated WooCommerce to version 2.0.19 and i also couldn't find where to delete the Australian states in class-wc-countries.php file.

    In WC version 2.0.1 and 2.0.19 the class-wc-countries.php file states in the first paragraph that they are both version 1.6.4 so i used the class-wc-countries.php file from Woo Commerce 2.0.1 and it works perfectly

    The WooCommerce countries class stores country/state data.
    *
    * @class WC_Countries
    * @version 1.6.4

    Cheers Pete

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic