10 ), $atts ) ); $user_id = get_current_user_id(); $order_id = ( isset( $_GET['order'] ) ) ? $_GET['order'] : 0; $order = new WC_Order( $order_id ); if ( $order_id == 0 ) { wc_get_template( 'myaccount/my-orders.php', array( 'order_count' => 'all' == $order_count ? -1 : $order_count ) ); return; } if ( !current_user_can( 'view_order', $order_id ) ) { echo '
' . __( 'Invalid order.', 'woocommerce' ) . ' ' . __( 'My Account', 'woocommerce' ) . '' . '
'; return; } $status = get_term_by('slug', $order->status, 'shop_order_status'); wc_get_template( 'myaccount/view-order.php', array( 'order_id' => $order_id, 'order' => $order, 'status' => $status ) ); } }