4

I want to change the woocommerce checkout page's 'order notes' text field to 'special notes'. But I couldn't find the exact location of this file. Where I can find this file in my localhost folder?

Here is the screenshot of the page:

Here is the screenshot of the page

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399

3 Answers3

11

In this situation direct don't try to edit in plugin files. instead of that try to search for hook.

Here is the code you can add it in function file. it will change text and place holder also

function md_custom_woocommerce_checkout_fields( $fields ) 
{
    $fields['order']['order_comments']['placeholder'] = 'Special notes';
    $fields['order']['order_comments']['label'] = 'Add your special note';

    return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'md_custom_woocommerce_checkout_fields' );
Mahen
  • 369
  • 3
  • 10
0

To achieve that you need to use the woocommerce_checkout_fields filter and set $fields['order']['order_comments']['label'] to the text you want.

Here is the code for it. You should add it to your theme's function.php file or plugin.

add_filter( 'woocommerce_checkout_fields', 'change_order_note_label' );
/**
 * Change Order Notes Label - WooCommerce
 *
 */
function change_order_note_label( $fields ) {

    $fields['order']['order_comments']['label'] = 'Special notes';
    return $fields;
}
Filcp
  • 199
  • 7
0

It worked for me

add_filter( 'woocommerce_checkout_fields' , 'theme_override_checkout_notes_fields' );

// Our hooked in function - $fields is passed via the filter!
function theme_override_checkout_notes_fields( $fields ) {
     $fields['order']['order_comments']['placeholder'] = 'Add some order notes or a gift message here.';
     $fields['order']['order_comments']['label'] = 'Order notes or  gift message';
     return $fields;
}
HB.
  • 4,116
  • 4
  • 29
  • 53