Skip to content
Advertisement

Issue adding and processing a custom checkout select field in WooCommerce

I am trying to add a dropdown field at checkout which needs to be validated before order submission and stored in the order for admin to view in order details. But for some reason even after i select the dropdown option, it says a value must be selected for the field.

JavaScript

Advertisement

Answer

You can’t add a custom checkout field outside the checkout form, as it’s not posted… Use the following complete replacement code instead:

JavaScript

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

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