Merge pull request #28893 from woocommerce/tracker_return_string_values
Tracker return string values for order related data
This commit is contained in:
commit
afbc0ab42d
|
@ -364,9 +364,11 @@ class WC_Tracker {
|
|||
);
|
||||
|
||||
$first = time();
|
||||
$processing_first = $first;
|
||||
$first_time = $first;
|
||||
$last = 0;
|
||||
$processing_first = time();
|
||||
$processing_last = 0;
|
||||
$order_data = array();
|
||||
|
||||
$orders = wc_get_orders( $args );
|
||||
$orders_count = count( $orders );
|
||||
|
@ -445,10 +447,25 @@ class WC_Tracker {
|
|||
$orders_count = count( $orders );
|
||||
}
|
||||
|
||||
$order_data['first'] = gmdate( 'Y-m-d H:i:s', $first );
|
||||
$order_data['last'] = gmdate( 'Y-m-d H:i:s', $last );
|
||||
$order_data['processing_first'] = gmdate( 'Y-m-d H:i:s', $processing_first );
|
||||
$order_data['processing_last'] = gmdate( 'Y-m-d H:i:s', $processing_last );
|
||||
if ( $first !== $first_time ) {
|
||||
$order_data['first'] = gmdate( 'Y-m-d H:i:s', $first );
|
||||
}
|
||||
|
||||
if ( $processing_first !== $first_time ) {
|
||||
$order_data['processing_first'] = gmdate( 'Y-m-d H:i:s', $processing_first );
|
||||
}
|
||||
|
||||
if ( $last ) {
|
||||
$order_data['last'] = gmdate( 'Y-m-d H:i:s', $last );
|
||||
}
|
||||
|
||||
if ( $processing_last ) {
|
||||
$order_data['processing_last'] = gmdate( 'Y-m-d H:i:s', $processing_last );
|
||||
}
|
||||
|
||||
foreach ( $order_data as $key => $value ) {
|
||||
$order_data[ $key ] = (string) $value;
|
||||
}
|
||||
|
||||
return $order_data;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue