• Resolved 1796media

    (@1796media)


    I need to add this field to the invoice: delivery_date

    I use the WooCommerce plugin for checkout field editing, and this custom field is essential for my site.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Upendra Kapse

    (@wpupen)

    Hi @1796media,

    First of all, apologies for the delay in getting back to you on this.

    We do have a filter using which you can add a custom field to the Invoice using the meta key of that field. Here’s an example code snippet that will help you do this:

    function example_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 )
            );
        }
        
     
        return array_merge( $fields, $new_fields );
    }
    add_filter( 'wcdn_order_info_fields', 'example_custom_order_fields', 10, 2 );

    You can use the meta key for your delivery date field in the above code snippet to add your field to the Invoice.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Add Custom Field’ is closed to new replies.