Display Recent Orders – WooCommerce

I’ve been working on WooCommerce plugin lately and one of the required functionality is to display current user Recent Orders, I know Recent Orders and Downloaded Products are added under My Account page but this time I choose to create a new page template just for this functionality so it display as normal page or same on other site pages layout.

This is also helpful if you don’t want your site customer to see those bunches of stuff, like Edit billing and shipping information, profile information and other stuff.

Without further ado, let’s get started.

Complete Code

You can create a new page template and add the below code directly.

That’s it happy coding ^_^

by Ryan Sutana

  • Mick Wang


    Thanks for the script, however it doesn’t seems to work, would you be able to provide the version with the page template section included?



  • Eduard

    Code works, but it’s outdated, atm Woocommerce has it’s own my-orders.php in it’s template folder, you can use that file to build a page template.

    ps. you got a space after < and before ?php, from line 14 onwards.

    • Thanks for pointing that out but considering the article is publish 2014 :), I might release new update for the new WC version and for the < spacing, it's my crappy Code Highlighter gonna try another one I think 😀

  • Snehal Patel

    Hi Ryan,

    Thanks for sharing this code, it still works with WooCommerce 2.5.5 and it is of a great help 🙂

  • wasting-time

    Unselectable code… wasting my time

    • That looks to me you’re not patient Developer nor an observer Developer, if you look closely there’s a lot of toggle to choose from, plain, php, copy and etc.

  • Hazel

    Hi Ryan, would you know I can order dates in woocommerce? So for example, if I book a room reservation for 30 June, 1 July, 2 July. I want woocommerce to show the dates in that order and not like this

    1 July
    2 July
    30 June

    Can you help?