How to get the Order status changed date in Woocoomerce?

点点圈 提交于 2019-12-08 14:09:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!