I'm trying to add order time next to the date on the Thank you screen and in the default Processing order email to the customer. Currently, it looks as follows:
Thank you page: https://i.stack.imgur.com/f0v6Y.png
Processing order email: https://i.stack.imgur.com/NwaU0.png
I've tried messing around with original files on the lines mentioned here below, e.g. $order->get_date_created("d-m-Y, H:i")
but without any success.
email-order-details.php line 34:
echo wp_kses_post( $before . sprintf( __( '[Order #%s]', 'woocommerce' ) . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) );
and thankyou.php line 51-54:
<li class="woocommerce-order-overview__date date">
<?php esc_html_e( 'Date:', 'woocommerce' ); ?>
<strong><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
</li>
Here they were able to add the time on a separate row in the emails, with editing the functions.php file. The only difference with my question is, they added the date and time on a separate row, so now you have 2 lines with dates. And this doesn't work on "Thank you" page.
Can you help me with similar kind of code (so code to add in the functions.php file) but more precise to my question?
Thanks
question from:
https://stackoverflow.com/questions/65941288/add-created-date-timestamp-to-woocommerce-customer-emails 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…