How can I echo the status from the WC_Order Object from WooCommerce from a WordPress Plugin?
I seem to be able to echo every other value except that one. Here is the object:
$order = new WC_Order( $order_id );
WC_Order Object
(
[id] => 222
[prices_include_tax] =>
[tax_display_cart] => excl
[display_totals_ex_tax] => 1
[display_cart_ex_tax] => 1
[order_date] => 2014-12-17 01:30:06
[modified_date] => 2014-12-17 01:30:08
[customer_message] =>
[customer_note] =>
[post_status] => publish
[status] => processing
)
I have been able to echo the id using:
echo $order->id;
When I try this, it’s blank:
echo $order->status;
Correct way to get status is via get_status method:
I was able to do this by putting the the Object into an array. My guess is that the status was a private object member.