luke-sully
luke-sully

Reputation: 323

Woo commerce change titles on checkout page

Can anyone direct me to where I can find the file where I can change the "State/County" and "Zip Code" titles in a woocommerce checkout page?

Upvotes: 1

Views: 5783

Answers (1)

WooCommerce offers hooks for this: please check Customizing checkout fields using actions and filters

as you'll see on that page you can hook a function (that you'll save in your childs functions.php for example ) to WooCommerce checkout page and change the data that is available.

so your code will look something like:

/ Hook in
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields( $fields ) {
     $fields['shipping']['shipping_postcode']['label'] = 'My new postcode title';
     $fields['shipping']['shipping_state']['label'] = 'My new state title';
     return $fields;
}

other examples and fields on the linked page.

Upvotes: 2

Related Questions