问题
I need to get the date in which the order status is changed.
For example 123 is order id , the order is created in 12-12-2015 , and order is confirmed in 13-12-2015 . So I need to know in which date order is confirmed from order id?
回答1:
In woocommerce,
Try
$order = new WC_Order($order_id);
echo $order->modified_date;
回答2:
Never access order properties directly. Use this to get the order modified date:
$order = new WC_Order($order_id);
$modified_date = get_the_modified_date( $order );
echo $modified_date;
来源:https://stackoverflow.com/questions/34369846/how-to-get-the-order-status-changed-date-in-woocoomerce