Skip to content
Advertisement

Custom WooCommerce datepicker checkout field saved and displayed on orders and emails

I have added a new custom datepicker field on the WooCommerce checkout page.

I am using Enabling a date-picker in Woocommerce checkout fields. All it’s OK On checkout page.

But now I really don’t know how can I save and add this new field on the order notes. Any help is appreciated.

Advertisement

Answer

Section 1

The following will display a custom datepicker field on checkout, it will validate the field and save It.

The chosen date will be displayed on admin order, customer order and emails

To include this date on customer note, use the code from “section 2” at the end.

The code:

JavaScript

Code goes in functions.php file of your active child theme (or active theme). Tested and works.


Section 2

To add this field to Customer order notes you will use the following instead:

JavaScript

Code goes in functions.php file of your active child theme (or active theme). Tested and works.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement