Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Customize the Placeholder Text in WooCommerce Billing & Shipping Address Fields?

Providing the user’s preferred language instructions on the placeholder values of the checkout fields is one valuable customization. The code changes the default English placeholders for billing and shipping fields to French placeholders to make the checkout process more user-friendly for French-speaking users.

add_filter( 'woocommerce_checkout_fields' , 'ts_override_billing_checkout_fields', 20, 1 );
 function ts_override_billing_checkout_fields( $fields ) {

     $fields['billing']['billing_first_name']['placeholder'] = 'Prénom';
     $fields['billing']['billing_last_name']['placeholder'] = 'Nom';
     $fields['billing']['billing_company']['placeholder'] = 'Nom de la société (optionnel)';
     $fields['billing']['billing_postcode']['placeholder'] = 'Code postal';
     $fields['billing']['billing_phone']['placeholder'] = 'Téléphone';
     $fields['billing']['billing_city']['placeholder'] = 'Ville';


     $fields['shipping']['shipping_first_name']['placeholder'] = 'Prénom';
     $fields['shipping']['shipping_last_name']['placeholder'] = 'Nom';
     $fields['shipping']['shipping_company']['placeholder'] = 'Nom de la société (optionnel)';
     $fields['shipping']['shipping_postcode']['placeholder'] = 'Code postal';
     $fields['shipping']['shipping_phone']['placeholder'] = 'Téléphone';
     $fields['shipping']['shipping_city']['placeholder'] = 'Ville';

     return $fields;
 }

Output

In the below output, the placeholder text is changed to French for various address-related fields. For eg: ‘PrĂ©nom’ refers to the first name and ‘Nom’ refers to the last name.

Related Article: How to Customize The Shipping Total on the WooCommerce Checkout?

How to Customize the Placeholder Text in WooCommerce Billing & Shipping Address Fields? - Tyche Softwares

You can also narrow down this customization to replace only the text of address fields. Explore further on how to change the billing address placeholder text in WoCommerce checkout to change the values of specific fields.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x