Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter tel7

    (@tel7)

    Thank you so much yukikatayama, that’s great!

    Although it’s not explicitly stated in that post, having successfully tested it myself it looks as if adding “\n{state}” after “{postcode}” on the following line of woocommerce/includes/class-wc-countries.php will do it:
    ‘NZ’ => “{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{country}”,
    So the new line would be:
    ‘NZ’ => “{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{state}\n{country}”,
    That puts the region (state) on the line after the city + postcode.
    If I decide to use that, I’ll need to work out how to put it in a plugin, because I assume the next time I take a WooCommerce update such a change would be overwritten.

    If anyone knows what code would need to go into a plugin, please post that code here. I guess a child theme option would also work, but I’m putting all my tweaks in a single plugin, in the hopes that’s more efficient.

    Thanks.
    TRS

    Thread Starter tel7

    (@tel7)

    Hello?

    Thread Starter tel7

    (@tel7)

    Seems to have stopped, thanks Mark!

    Thread Starter tel7

    (@tel7)

    OK Gemma, I’ve sent the site address via the link you provided.

    I await your response.

    Terry

    Thread Starter tel7

    (@tel7)

    Thanks for your prompt response and suggestion, Shane.

    Questions:

    Q1. Is “region” really a custom field? I haven’t added it as a custom field. It automatically appears in the Checkout page presumably because I’ve specified New Zealand somewhere in the settings. The code I linked to in my original post may give a clue to this. I see that it refers to this field: $locale[‘NZ’][‘state’][‘required’], so does that mean “state” is being used to store region data? Is that a custom field?

    Q2. If “region” is NOT a custom field, then does your suggestion above apply?

    Q3. Without “hacking” into the database, how can I know the region data is even being stored when people place orders? As mentioned in my first post, I can’t even see it in Dashboard > WooCommerce > Orders. So where can I see it?

    Q4. How can I make the “region” appear under Dashboard > WooCommerce > Orders?

    Thanks.
    TRS

Viewing 5 replies - 1 through 5 (of 5 total)