May 29, 2014

How to get downloadable files with Woocommerce order id?

How to get downloadable files with Woocommerce order id?

global $user_orders, $set_number;
$the_order = new WC_Order( $user_orders->ID );
$order_meta = $the_order->get_items();
$order_item = current($order_meta);
$has_downloadable_item = $the_order->has_downloadable_item();
if($has_downloadable_item){
$files_urls = $the_order->get_item_downloads($order_item);
}

Last updated: May 29, 2014