WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] Change "Select a state" to "Select a region" on Checkout page (6 posts)

  1. Chrisp2408
    Member
    Posted 1 year ago #

    Is there a way that I can change the wording of "Select a state" to
    "Select a region" on the checkout page at the State / County drop down box please?

    Thanks
    Chris

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

  2. Yojance
    Member
    Posted 1 year ago #

    Try adding this to your Theme's function.php file:

    add_filter( 'woocommerce_billing_fields', 'wc_billing_fields_state_filter', 10, 1 );
    
    function wc_billing_fields_state_filter( $address_fields ) {
    	$address_fields['billing_state']['label'] = 'Select a region';
    	return $address_fields;
    }
  3. Chrisp2408
    Member
    Posted 1 year ago #

    Hi Yojance, that worked as far as the label changes, but the drop down menu still starts / defaults to "Select a State" - Any ideas how to change the drop down list default from "Select a State" to "Select a Region" too?

    Thanks
    Chris

  4. Yojance
    Member
    Posted 1 year ago #

    I looked at the code and this value seems to be hardcoded inside woocommerce-template.php around line 1384.

    I would never edit any files directly because these might be overriden once you update your plug-in. Sounds like jQuery is the way to go in order to change the value of the first drop down.

  5. Chrisp2408
    Member
    Posted 1 year ago #

    Thanks Yojance. Solved.

    Cheers
    Chris

  6. TokerCoughin
    Member
    Posted 10 months ago #

    Chrisp2408, can you share what you did to solve this ?

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.