So this is the function I have for my above code:
add_filter( 'mt_handle_custom_cart_data', 'my_save_custom_field', 10, 2 );
function my_save_custom_field( $payment, $post ) {
update_post_meta( $payment, '_tag', $_POST['tag'] );
update_post_meta( $payment, '_country', $_POST['country'] );
}
add_filter( 'mt_show_in_payment_fields', 'my_show_custom_field', 10, 2 );
function my_show_custom_field( $output, $post_ID ) {
$tag = get_post_meta( $post_ID, '_tag' );
$country = get_post_meta( $post_ID, '_country' );
return $output . $tag . $country;
}
As far as I can find, the input data is still not showing anywhere. I must be doing something wrong here.