Custom Note In Billing Details
-
Hi Guys
I need to add a custom note under the phone number field in the Billing details section at the checkout.
Could someone point me to the area in the code where i can make that change. Refer to the highlighted text in the attached image.
Attachments:
You must be
logged in to view attached files.
I ended up working this one out by myself.
Added the following to my child theme’s function.php
/**
** Hook into Billing Phone Number at Checkout
**/
add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_phone'] = array(
'label' => __('Phone'),
'class' => array('billing-phone-xtra-note'),
'required' => true
);
return $fields;
}
And then added this to my custom CSS
/* ADD NOTE AFTER BILLING PHONE NUMBER */
.billing-phone-xtra-note {
padding-bottom: 0px;
}
.billing-phone-xtra-note:after {
content: 'Number required so we can contact you about your order';
font-size: 12px;
}
Attachments:
You must be
logged in to view attached files.
Hello,
Sound’s Great!..
I’m glad that you added that custom note under the phone number field in the Billing details in checkout page by yourself.
You are the best. Thanks for sharing the code snippet on our forum it might help others. Feel free to write back for further assistance.
Topic Closed.
Best Regards.
The topic ‘Custom Note In Billing Details’ is closed to new replies.