WooCommerce: Add “Order Again” Button in My Account

Woocommerce WooCommerce Customization WooCommerce Development Woocommerce Hooks WooCommerce Tips Wordpress WordPress Development

WooCommerce: Add “Order Again” Button in My Account Tutorial/Guide

Give your WooCommerce customers an easy way to reorder with an "Order Again" button on the My Account → Orders page. This helps improve repeat purchases and customer satisfaction.

Why Enable the "Order Again" Feature?

This button is perfect for stores selling recurring or frequently purchased products. With one click, users can add items from past orders directly to the cart—no need to browse again.

Steps to Add the Button

Follow the steps below to implement it into your site:

Step 1: Add the Code to functions.php

Place this snippet inside your theme’s functions.php or a custom plugin:

// Add "Order Again" button to WooCommerce My Account → Orders
function custom_add_order_again_button($order_id) {
    $order = wc_get_order($order_id);

    if ($order && in_array($order->get_status(), array('completed', 'processing'))) {
        $order_again_url = wc_get_cart_url() . '?order_again=' . $order_id;
        echo '<a href="' . esc_url($order_again_url) . '" class="button order-again">' . __('Order Again', 'woocommerce') . '</a>';
    }
}
add_action('woocommerce_my_account_my_orders_actions', 'custom_add_order_again_button');

Step 2: Save and Verify

Now go to My Account → Orders and view a completed or processing order. You’ll see a new “Order Again” button beside each one.

Note

The button only appears for orders that are either completed or processing. You can customize the conditions or button style further as needed.  

💡 Have a Coding Problem?

Search our archives or reach out to our team for solutions and expert advice.