Viewing 1 replies (of 1 total)
  • yes, you can, if you have a plugin installed that generates invoice numbers for you. woocommerce and woocommerce delivery notes has no concept of invoice numbering, so you need another plugin that can do that (but not this one).

    otherwise, in the faq you can learn how to add custom fields to the print template:

    http://wordpress.org/plugins/woocommerce-delivery-notes/faq/

    How can I add some more fields to the order info section?

    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 the get_post_meta( $order->id, ‘your_meta_field_name’, true); function and of course the your_meta_field_name.

    An example that adds a ‘VAT’ and ‘Customer Number’ field to the end of the list. Paste the code in the functions.php file of your theme:

    function my_custom_order_fields( $fields, $order ) {
        $new_fields = array();
    
        if( get_post_meta( $order->id, 'your_meta_field_name', true ) ) {
            $new_fields['your_meta_field_name'] = array(
                'label' => 'VAT',
                'value' => get_post_meta( $order->id, 'your_meta_field_name', true )
            );
        }
    
        if( get_post_meta( $order->id, 'your_meta_field_name', true ) ) {
            $new_fields['your_meta_field_name'] = array(
                'label' => 'Customer Number',
                'value' => get_post_meta( $order->id, 'your_meta_field_name', true )
            );
        }
    
        return array_merge( $fields, $new_fields );
    }
    add_filter( 'wcdn_order_info_fields', 'my_custom_order_fields', 10, 2 );
Viewing 1 replies (of 1 total)

The topic ‘Invoice numer’ is closed to new replies.