I\'m trying to add custom fields to the WooCommerce checkout and there seems to be no output for hidden fields.
In woocommerce-template.php
, hidden fie
If you can pull the info you need and put it into a variable you can totally bypass the need to put the info in the form. Just add the info directly to update_post_meta.
I needed to add a value stored in a COOKIE and originally set out to add it as hidden field on the form but end up doing this instead:
/**
* Add the hidden referral info field to the checkout
*/
add_action( 'woocommerce_checkout_update_order_meta', 'your_hidden_data' );
function your_hidden_data( $order_id ) {
/*
Put your normal field saves here if needed
*/
$cookie_name1 = $_COOKIE['ref_src']; //Get my Cookie and Assign it
//Your hidden fields
update_post_meta( $order_id, 'Referral_Source', $cookie_name1 );
}