WooCommerce rename fields and make them required

Notice: A non well formed numeric value encountered in /customers/b/b/d/puddinq.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118Notice: A non well formed numeric value encountered in /customers/b/b/d/puddinq.com/httpd.www/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

The following code can be pasted in your functions.php file and works immediate.

To unravel the code above: the filter holds the $fields in an array. We change the values of the array to get what we want. We are changing both the ‘billing’ and shipping form, changing the address_1 and address_2 field labels and placeholder. In the case of address_2 we also set the required to 1 to make the field required.

  • All other fields remain the same
  • The fields will hold the same place in mails, and orders.