Home WordPressWooCommerce How to change text on addition notes in woo-commerce ?

How to change text on addition notes in woo-commerce ?

by admin
0 comment 131 views

How to change text on addition notes in woo-commerce ?

Many times there needs to be change of text in fields at checkout page. To do so, open functions file of current theme. Add a new function for replacing text  at checkout page. $field variable needs to be passed to function. For example, if Additional information, order notes needs to change from checkout page for label and placeholder.  At last fields needs to return.

function labotrees_additional_info_change($fields ) 
{
  $fields['order']['order_comments']['label'] = 'Labotrees Message';
  $fields['order']['order_comments']['placeholder'] = 'Labotrees placeholder Message';

}

At last add_filter( ) function of woo-commerce is used to replace all fields  as follow.

add_filter( 'woocommerce_checkout_fields' , 'labotrees_additional_info_change' );

 

That’s it.

Leave a Comment

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy