nevercrox.com

WooCommerce Show Custom Content Under Checkout Fields

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

Sometimes, you might want to provide extra instructions to your customers as they complete the WooCommerce Checkout form. This quick guide demonstrates how to add custom content under the fields. Specifically, we’ll show you how to add the text “As shown on your passport” beneath the first name billing field. To add custom content under other fields, just modify the snippet as needed.
Code Snippet 1 ( Paste This Code In functions.php or Code Snippets )
/**
* Snippet Name:     Show custom text (field descriptions) under WooCommerce checkout fields.
* Snippet Author:   Nevercrox Solutions
*/

add_filter( 'woocommerce_billing_fields', 'nevercrox_custom_content_under_checkout_fields' );

function nevercrox_custom_content_under_checkout_fields( $fields ) {
    $fields['billing_first_name']['description'] = 'As shown on your passport';
    return $fields;
}

 
Code Snippet 2 ( Paste It In CSS or Code Snippets )
<style>
/* Author: Nevercrox Solutions */
#billing_first_name-description {
    display: inline !important;
}
</style>

 

Just Added Blogs

Need A Specifc Blog ?

Request A Blog

Check Out More Related Snippets