WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Unable to checkout in Portugal-gives "State / County is a required field." Error (4 posts)

  1. charliezl
    Member
    Posted 1 year ago #

    I think this was an issue long ago for Countries without States or provinces.

    Anyways, Portugal has no state or provinces and the validation will not pass even though no option was given to input state or province.

    This issue occurred in 2.0.4.

    Can the validation for State/Prov be turned off if the Country do not have a State, other wise disable state as a whole.

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

  2. charliezl
    Member
    Posted 1 year ago #

    I have found the permanent fix for this. It seems to be the developer's error for leaving Portugal out of the main countries array. Simplly add this piece of code

    'PT' => array(
    	'state'	=> array(
    	'required' => false
          ),
    ),

    to the get_country_locale() function of the class-wc-countries.php in woocommerce classes folder.

  3. autopress
    Member
    Posted 1 year ago #

    I have the same problem, hope this fix solves the problem.

  4. autopress
    Member
    Posted 1 year ago #

    Thanks, this fix worked perfectly for Portugal.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic