Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @dannwagner,

    Thank you for providing the screenshot.

    Can you please let me know

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @dannwagner,

    Please ignore my previous response as it got sent mistakenly while drafting.

    Thank you for providing the screenshot.

    Can you please let me know exactly which date and time you want to print on the invoice? Also, do you want it to print in front of the text “Data do pedido” as shown in the provided screenshot?

    Please share the details so I will pass your requirement to the development team and will let you know the update of the same.

    Thread Starter Daniel Godoi Wagner

    (@dannwagner)

    Thanks for the response! Sure I want to print by side of “Data do Pedido” – putting time and date of it. Thanks a lot!

    Thread Starter Daniel Godoi Wagner

    (@dannwagner)

    I mean, the date and time of the order, ok?

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @dannwagner,

    Sorry for the delay in response to this.

    We do have a filter named ‘wcdn_order_info_fields’ available in our plugin which you can use to add the date & time in the Order info section. You can use this filter and write the function code as per your requirements.

    Do let us know if you have any queries about this.

    Thread Starter Daniel Godoi Wagner

    (@dannwagner)

    Could you please elaborate a function for it? I am not using the new version, because it was not working well, overpassing several functions still working fine. Will not use it so soon. Will thank you a lot if can send me the function.

    Thread Starter Daniel Godoi Wagner

    (@dannwagner)

    also came here to inform that I have tested the date with the new plugin and it is still blank.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @dannwagner,

    Sorry for the delay in response to this.

    Our developer has checked on this and created a code snippet to achieve your requirements. Kindly add this below-provided code snippet under the “functions.php” file of your active theme.


    function custom_order_info_fields( $fields, $order ) {
    // Fetch order date and time
    $order_date = date_i18n( 'F j, Y', strtotime( $order->get_date_created() ) );
    $order_time = date_i18n( 'H:i:s', strtotime( $order->get_date_created() ) );
    // Concatenate date and time
    $order_date_time = $order_date . ' at ' . $order_time;
    // Update the 'order_date' field with the new label and value
    if ( isset( $fields['order_date'] ) ) {
    $fields['order_date']['label'] = 'Order Date and Time';
    $fields['order_date']['value'] = $order_date_time;
    }
    // Merge the custom fields with the existing fields
    $fields = array_merge( $fields );
    return $fields;
    }
    add_filter( 'wcdn_order_info_fields', 'custom_order_info_fields', 10, 2 );

    Once you will add this code, the date and time will be displayed like this: https://prnt.sc/6vFC6PNOzRdX
    This filter code will work for simple template also. So you can update the plugin in future.

    Please check and feel free to let us know if you have any queries.

    Thread Starter Daniel Godoi Wagner

    (@dannwagner)

    THANKS A LOT, IT WORKED FINE, GREAT FUNCTION!

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @dannwagner,

    You’re always welcome ??

    I am glad to know that the provided function code is working fine for you.

    Feel free to write back to us if you have any further queries.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.