Order Date incorrect
-
I just noticed, in my woocommerce, an order is stated there it was made on 10/29/2023. however in this plugin print invoice and print receipt page it generates, it states the order date is 10/30/2023. i think the plugin is using the server timezone. maybe it should use the wordpress configured time zone. I think you could change in the file includes\wcdn-template-functions.php the function wcdn_get_order_info
where it says:
$fields['order_date'] = array( 'label' => __( 'Order Date', 'woocommerce-delivery-notes' ), 'value' => date_i18n( get_option( 'date_format' ), strtotime( $wdn_order_order_date ) ), );
replace it with:// Get the WordPress timezone $timezone = get_option('timezone_string') ? get_option('timezone_string') : 'UTC'; // Convert the order's date to the WordPress timezone $order_date_object = new DateTime( $wdn_order_order_date, new DateTimeZone( 'UTC' ) ); $order_date_object->setTimezone( new DateTimeZone( $timezone ) ); $order_date_formatted = $order_date_object->format( get_option( 'date_format' ) ); $fields['order_date'] = array( 'label' => __( 'Order Date', 'woocommerce-delivery-notes' ), 'value' => $order_date_formatted, );
note that chatgpt helped make that change above, so please check it for yourself to see it it is good.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Order Date incorrect’ is closed to new replies.