How to add Order Again button to WooCommerce My Account / Previous Orders page

May 22, 2019 | WooCommerce Tips | 1 comment

Add the function below to your child theme functions.php file. [php] /** * Add order again button in my orders actions. * * @param array $actions * @param WC_Order $order * @return array */ function cs_add_order_again_to_my_orders_actions( $actions, $order ) { if ( $order->has_status( ‘completed’ ) ) { $actions[‘order-again’] = array( ‘url’ => wp_nonce_url( add_query_arg( ‘order_again’, $order->id ) , ‘woocommerce-order_again’ ), ‘name’ => __( ‘Order Again’, ‘woocommerce’ ) ); } return $actions; } add_filter( ‘woocommerce_my_account_my_orders_actions’, ‘cs_add_order_again_to_my_orders_actions’, 50, 2 ); [/php]

Need help with this?
Hire me for a consultation and I'll walk you thru the process.

1 Comment

  1. Hwo to add Review button on every completed order in my account section in woocommerce.

    Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

5 star reviews
"WOW! Money WELL spent. Joseph was incredibly knowledgeable in helping me make some final tweeks to my Divi website. He was very caring and went above and beyond. Will 100% use him for any future Divi website needs."
Claire - CMMC

5 star reviews
"You really get what you pay for with Joe. He does more than simply build a website, he sets up websites for success. Functional, clean, professional designs and he keeps up/implements the latest plugins and technology. Thank you Joe. I will continue to refer you work."
Mark Winger

5 star reviews
"The best WordPress guy I’ve worked with on WordPress, hands-down (and I’ve worked with dozens). Remarkably good with theme customizations with a quick turn. Kept it on budget as well. A rarity with hourly contracts."
Nate Wright

5 star reviews
"Thanks for your prompt reply. You’re always so comprehensive. If we could write another review just for your communication skills, then we would."
Alex N

More Tips

Ask a Question

"*" indicates required fields