Streamline Repeat Sales with an "Order Again" Shortcut

Customer retention is key to a profitable store, and making it easy for returning users to buy their favorite items again is a proven strategy. By default, WooCommerce offers an "Order Again" feature, but it may not always be visible on the main account dashboard depending on your theme. This tutorial shows you how to hook into the account order actions to display a prominent reorder link. This shortcut directly populates the cart with items from a previous order, saving the customer time and significantly boosting your conversion rates for recurring products.

Enable “Order Again” in WooCommerce My Orders

Ajax Ajax Wordpress Code Snippets E-Commerce Tips PHP Debugging PHP Snippets Woocommerce WooCommerce Custom Code Woocommerce Hooks WooCommerce Tips Wordpress WordPress Development

Enable “Order Again” in WooCommerce My Orders Tutorial/Guide

Help your users reorder past purchases easily by adding an "Order Again" button on the WooCommerce My Account → Orders page. Great for user experience and conversions.

Why Use an "Order Again" Button?

This feature is ideal for stores where users frequently purchase the same items. It reduces the time they spend navigating and encourages repeat orders with one click.

How to Implement

Here’s a quick 2-step process to activate this feature on your WooCommerce store.

Step 1: Add PHP Snippet

Insert the following code into your functions.php or a site-specific plugin:

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: Test the Button

Visit your WooCommerce My Account area. For any completed or processing order, a new "Order Again" button will now be visible, allowing one-click reordering.

Tips

This only works for orders with a status of completed or processing. Want to go further? Use filters to add conditions or styling as needed.  

๐Ÿ’ก Have a Coding Problem?

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