WooCommerce: Order Again Button @ My Account > Orders
The WooCommerce “Order Again” button displays for ‘completed’ orders on the Thank You page and View Order page. That’s a pity, because it would be useful to show it on the My Account > Orders page as well, as a custom “action”, same as the “View”, “Pay” (if pending), “Cancel” (if subscription), “Edit” (custom snippet), “Confirm” (custom snippet) buttons.
The good news is that we can code it ourselves! And just reuse most of the code we already wrote, as well as rely on the WooCommerce “listener” for the existing “Order Again” button. Enjoy!
PHP Snippet: Add “Order Again” Button to My Account > Orders Action (Completed Orders Only)
If you’re wondering how I came up with the ‘url’ code in the snippet below, I simply reused the exact same code of the woocommerce_order_again_button() function.
Also, somewhere in the Cart class, there is a “listener” that triggers when the button is clicked – see get_cart_from_session() – so because I’m using the exact same button URL, the listener triggers from the new button position as well.
Please let me know in the comments if everything went as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting.
Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!
Business Bloomer Founder
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.
6 thoughts on “WooCommerce: Order Again Button @ My Account > Orders”
Hello Rodolfo, first of all, thanks for this snippet. We have tested this inside an eCommerce website me manage, but somethiing really weird happens after we click on the order again button: it redirects us to the Cart (as I believe it is suppose to be..) but then the cart is empty. Even if I have something in the cart before clicking the order again button (at any order available in my account, inside the Orders Tab).. the Cart gets always emptied. What could we do to solve this issue?
A cache issue maybe?
HI there, my client want a option and i hope i can explain it well.
situation: a client made an order. en later the same client want ot make an order again en then he needs to combine te orde in the checkout. so he want a button ” combine order” then he need to enter his order number of the first order” my client wants this so he can combine it in 1 shipping and the customer only pays 1 shipping. i hope you understand what my client need
Hello Michel, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
Hi seems to work but it is next to the view button. how could i add this down from the view button? Thanks
Thank you George! A bit of custom CSS would do in this case. Unfortunately this is specific to your theme so I can’t help here.