Add custom field from checkout manager plugin
-
Hi,
I am using your plugin for printing delivery notes.
However, during the checkout I have added a singole custom field. This was done by using the plugin ‘Checkout Manager’. I need that field in the printed note, so I add the following code to the function.php of my theme:(wooccm0 is the name of the new field)
function example_custom_order_fields( $fields, $order ) { $new_fields = array(); if( get_post_meta( $order->id, 'wooccm0', true ) ) { $new_fields['wooccm0'] = array( 'label' => 'Codice ISS', 'value' => get_post_meta( $order->id, 'wooccm0', true ) ); } return array_merge( $fields, $new_fields ); } add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 1 );
However, when I print the order I am still not able to see the new field.
How can I do?Thanks for help
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add custom field from checkout manager plugin’ is closed to new replies.