This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. Adds a custom field. NB. I am using some Norwegian words in the below text. | |
* 2. Then adds a validate error message if person does not fill out the field. | |
* 3. Then adds the custom field to the order page. | |
https://businessbloomer.com/woocommerce-add-custom-checkout-field-php/ | |
https://businessbloomer.com/woocommerce-add-shipping-phone-checkout/ | |
https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/#section-6 | |
*/ | |
add_action( 'woocommerce_before_order_notes', 'my_custom_checkout_field' ); | |
function my_custom_checkout_field( $checkout ) { |