nevercrox.com

WooCommerce Change Checkout Field Placeholders

Pre-Requisites

There are no pre-requisites for this code snippet to work. Keep in mind this solution consists of two code snippets, one to display the content and one to style it.

How To Implement This Solution?

Add these two code snippets as separate entries in either your active child theme’s functions.php file or the Code Snippets plugin.

About The Snippet

Changing the checkout form field placeholders is a relatively straightforward task and can be customized based on your business needs. For example, the default Address Line 2 field is quite plain, and if you need to keep it, updating the placeholder text can improve its appearance. Be sure to check out our other guides on removing unnecessary checkout fields, as this can also enhance the customer experience. Now, let’s dive into how to change the WooCommerce checkout field placeholder text.

Code Snippet 1 (Paste This Code In functions.php or Code Snippets )
/**
* Snippet Name:     Customise the checkout field placeholders.
* Snippet Author:   Nevercrox Solutions
*/

add_filter( 'woocommerce_checkout_fields', 'nevercrox_change_checkout_placeholders', 9999 );

function nevercrox_change_checkout_placeholders( $f ) {

   // first name can be changed with woocommerce_default_address_fields as well
   $f['billing']['billing_first_name']['placeholder'] = 'As it appears on your ID';

   return $f;

}


 

Just Added Blogs

Need A Specifc Blog ?

Request A Blog

Check Out More Related Snippets

0
Would love your thoughts, please comment.x
()
x