Moobs
Regular Member
- Jan 30, 2015
- 270
- 23
I'm trying to create a function that will retrieve an order by its ID. For some reason I can't get the WC global function "get_order" to work. I'm passing a valid order id to the function and trying to print it out to verify that it's working. The function has been placed in my functions.php file.
Test Output:
Note: I have tested echoing other data out of the function without a problem.
Any help would be greatly appreciated.
Code:
function getWC_order_details($id){ global $woocommerce;
$order = get_order( $id );
print "<pre>";
print_r($order);
print "</pre>"; }
Test Output:
Code:
<php getWC_order_details(466); ?>
Note: I have tested echoing other data out of the function without a problem.
Any help would be greatly appreciated.