Organization Number for printing.
-
Hi,
I tried roughly all the plugins that I could find to print invoice, delivery notes etc.
But, even though the Organization Number is present in the order, it doesn’t show up when trying to print with these plugins.
Just wanted to check if it is related to the checkout plugin, so I can try to get in touch with those plugins support.
For example, I was using this plugin https://www.ads-software.com/plugins/woocommerce-delivery-notes/
But now it doesn’t work.
And this is what they have in the help section of the plugin:
Use the
wcdn_order_info_fields
filter hook. It returns all the fields as array. Read the WooCommerce documentation to learn how you get custom checkout and order fields. Tip: To get custom meta field values you will most probably need theget_post_meta( $order->get_id(), 'your_meta_field_name', true);
function and of course theyour_meta_field_name
.
An example that adds a 'VAT' and 'Customer Number' field to the end of the list. Paste the code in thefunctions.php
file of your theme:
function example_custom_order_fields( $fields, $order ) {
$new_fields = array();
if( get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ) {
$new_fields['your_meta_field_name'] = array(
'label' => 'VAT',
'value' => get_post_meta( $order->get_id(), 'your_meta_field_name', true )
);
}
if( get_post_meta( $order->get_id(), 'your_meta_field_name', true ) ) {
$new_fields['your_meta_field_name'] = array(
'label' => 'Customer Number',
'value' => get_post_meta( $order->get_id(), 'your_meta_field_name', true )
);
}
return array_merge( $fields, $new_fields );
}
add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );Wanted to be sure if their premium version would work?
Thanks.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.