Home » Wordpress Tutorials » How to make order notes field required?
How to make order notes field required?
Do you want to make order notes field required and show an error if order notes box is empty in WooCommerce?
You can either use plugin or a simple code snippet to make it work. Let’s have a look on both of these methods.
It’s quite simple you can add the snippet below and in your themes functions.php file or use code snippets plugin.
If you want to change the error message, Please see line number 6 in the code snippet and change the text “Please add delivery instructions“ to whatever you would like to.
Check out Field Editor for WooCommerce plugin provides an easy way to customise (add, edit, delete and change display order) your fields displayed on WooCommerce checkout page.
This plugin requires WooCommerce to be installed, activated, and configured.
Once you activate the plugin go to contact for tab from WordPress Admin Menu, On the right side of all fields you will see button labelled “Edit”.
Just click the button, A popup window will open to edit the fields settings. From here you can simply tick required box and save it.
And you are done, Now order notes will be a required field and customers will see an error if they don’t fill out this field.