WooCommerce Print Invoice & Delivery Note
[resolved] Display Delivery Time on Invoice (2 posts)

  1. yaang1
    Posted 1 year ago #

    Hello and thank you for a very nice plugin.

    My question is;
    I am currently using a plugin named WooCommerce Print Invoice & Delivery Note for invoices. To that, ive extended the information with another plugin named Delivery Time Picker for Shipping to customize the date you would want it delivered. The date you pick I would like to appear on my invoice. How is that possible?

    In the confirmation e-mail it would be very nice if it could be displayed.

    I´ve noticed a post a year ago with a similar problem, that solved it by hardcoding this snippet into template.php:

    <?php $delivery_date_label = get_option('orddd_delivery_date_field_label'); if ($order->order_custom_fields[$delivery_date_label][0] != '') { ?> <div> <h3><?php _e('Delivery Date', 'woocommerce-pip'); ?></h3> <?php echo $order->order_custom_fields[$delivery_date_label][0]; ?> </div> <?php } ?>

    Best regards,

    Dan Christensen


  2. piffpaffpuff
    Plugin Author

    Posted 1 year ago #

    Hi, thanks for your question. It is already answered in the 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.

    Important: 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 'Delivery Time' field to the end of the list. Paste the code in the functions.php file of your theme. Don't forget to replace your_meta_field_name with your field name:

    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' => 'Delivery Time',
                '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 );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce Print Invoice & Delivery Note
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic