WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » [Plugin: WooCommerce – excelling eCommerce] Change 'state' to 'province' in ship

[Plugin: WooCommerce – excelling eCommerce] Change 'state' to 'province' in ship

Viewing 15 replies - 1 through 15 (of 15 total)
  • check out class-wc-countries.php that’s where all the location specific stuff is dealt with … I haven’t quite figured out how to hook into some of it yet tho ….

    I should clarify, it does list Canadian provinces, but the title in the form field is “States”, with a drop down of provinces. I am looking through that file, but so far I can’t see anything. Thanks.

    line 831 …..

    'CA' => array('state'	=> array(
    'label'=> __('Province','woocommerce'),
    'placeholder'	=> __('Province', 'woocommerce')
    )
    ),

    But I think this is used only on the checkout page….

    I am looking to do this exact same thing with a Canadian client of ours. I was able to find the specific variable that controls this in plugins/woocommerce/woocommerce-template.php on line 1137.

    It shows <option value="">'.__( 'Select a state&hellip;', 'woocommerce' ) .'</option>'; where state&hellip is the variable. So while I can change this in the core file and it does work, I’d rather not do this for updating reasons. If there is a way to override this via functions.php that would be awesome.

    Plugin Author royho

    @royho

    If there isn’t already a filter for this, what you can do is use the PO file to translate it into “province”. This way you’re not modifying the core.

    Yeah, I’ve used this plugin to change some of the wording on the site … works really well…

    http://wordpress.org/extend/plugins/codestyling-localization/

    Thanks for the tip hilmon. The plugin did the trick. Royho, we’ve never really dealt with PO or MO files until now. Learn something new everyday!

    We do indeed!! 🙂

    Can installing that plugin slow anything down?

    I guess I don’t get how it works, is it simply showing already existing language files, or is it loading new ones?

    I mean, for changing something small like this (just a few words), is it worth it? Or is it better to learn how to go down the manual PO/MO route (I’m very new to that, but curious).

    Thanks!

    I’d like to remove the “Select a State” option altogether. How do I do this

    Add to functions.php in your theme this code:

    // Cut unnecessary fields
    add_filter( ‘woocommerce_checkout_fields’ , ‘custom_override_checkout_fields’ );
    function custom_override_checkout_fields( $fields ) {
    unset($fields[‘billing’][‘billing_state’]);
    return $fields;
    }

    Thanks I did this; however the drop down box for New Zealand provices and Australian States still appears

    It’s strange, maybe try in CSS hide this element:
    #billing_state {
    display: none;
    }

    Thanks I amended the states php file as suggested and that resolved my requirement

    Hey All, I’m trying to do as the OP was. Change “Select a state” to be “Province” both in the checkout area, and on the cart page if possible.

    Can anybody offer some insight as to how to accomplish this ?

    Thanks in advance,

    Sincerely,

    Chris Fawkz Coffin

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] Change 'state' to 'province' in ship’ is closed to new replies.
Skip to toolbar