How to edit the fields in Woocommerce?

Where is the .php file located to edit the billing fields?

I want to change the text for each heading; for example Last Name to Family Name.

Read More

This is using Woocommerce in the Avada theme.

I’ve managed to change the fields using this code, but city, state and postcode won’t change:

function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_first_name']['label'] = '名';
$fields['billing']['billing_last_name']['label'] = '姓'; 
$fields['billing']['billing_email']['label'] = 'メールアドレス';
$fields['billing']['billing_phone']['label'] = '電話番号';
$fields['billing']['billing_country']['label'] = '国';
$fields['billing']['billing_city']['label'] = '名!';
$fields['billing']['billing_city']['placeholder'] = '市町村';
$fields['billing']['billing_state']['label'] = '都道府県';
$fields['billing']['billing_state']['placeholder'] = '都道府県';
$fields['billing']['billing_postcode']['label'] = '郵便番号';
$fields['billing']['billing_postcode']['placeholder'] = '郵便番号';
$fields['billing']['billing_address_1']['label'] = '住所';
$fields['billing']['billing_address_1']['placeholder'] = '住所';
$fields['billing']['billing_address_2']['placeholder'] = 'アパート名等';
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

Related posts

1 comment

  1. Try increase your priority used:

    add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields', 50 );
    

Comments are closed.