At risk of sounding silly, where does this bit if code go? Info is still not saving to my order. The code I have at the end of my functions.php file is:
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields6' );
// Our hooked in function - $fields is passed via the filter!
function custom_override_checkout_fields6( $fields6 ) {
$fields6['billing6']['billing_infos6'] = array(
'type' => 'textarea',
'label' => __('Alternate Contact Info', 'woocommerce'),
'placeholder' => _x('', 'placeholder', 'woocommerce'),
'required' => false,
'class' => array('form-row-wide'),
'clear' => true
);
return $fields6;
}
/**
* Update the order meta with field value
*/
add_action( 'woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta' );
function my_custom_checkout_field_update_order_meta( $order_id ) {
if ( ! empty( $_POST['billing6'] ) ) {
update_post_meta( $order_id, 'Alternate Contact Info', sanitize_text_field( $_POST['billing6'] ) );
}
}
Thanks so much for your time!