SoftSquare Returning Customer History

Description

SoftSquare Returning Customer History shows WooCommerce store owners, at a glance, whether an order comes from a new customer or someone who has bought from you before, and how their earlier orders went.

WooCommerce only links orders together when the customer is logged in to the same account. Most shoppers check out as guests, so a loyal customer looks new every time, and a customer whose last three cash-on-delivery orders were cancelled looks no different from anyone else. This plugin matches orders on the details customers actually reuse: their billing email address and their phone number.

On the order screen, a Customer history box lists the customer’s earlier orders: order number, date, status, total, and which detail matched. Cancelled, failed and refunded orders stand out in red, and a summary counts the outcomes, such as “Completed: 4 · Cancelled: 1”.

In the orders list, a Customer column shows Repeat ×3 for a returning customer and New for a first order, so you can see your repeat business without opening a single order.

It is especially useful for cash-on-delivery stores: before you dispatch, you can see whether a customer has a history of cancelled orders.

This is an independent plugin by SoftSquare. It is not affiliated with, endorsed by, or supported by WooCommerce or Automattic. WooCommerce is a trademark of its respective owner and is used only to say which shop plugin this works with.

Features

  • Customer history box on the WooCommerce edit order screen, listing earlier orders from the same customer with date, status, total and the detail that matched
  • Repeat ×N / New badge in a Customer column of the WooCommerce orders list
  • Matches guest orders as well as account orders, by billing email, billing phone or customer account
  • Phone numbers are compared on their last 10 digits, so local and international formats of the same number match (for example 0300 1234567 and +92 300 1234567)
  • Email addresses are matched case-insensitively
  • Orders placed by staff while logged in to their own account are not linked by that account, so shop managers taking phone orders do not turn every customer into one
  • Cancelled, failed and refunded orders are highlighted, with a count of each outcome
  • Shows when the customer has also ordered again after the order you are viewing
  • Optional warning when earlier parcels were returned undelivered, for shipping and courier plugins that report it (see the developer notes)
  • One indexed database query per order, using WooCommerce High-Performance Order Storage
  • Compatible with WooCommerce High-Performance Order Storage (HPOS)
  • No settings to configure, nothing stored, and no data sent anywhere

Privacy

This plugin stores no data and makes no external requests. It reads existing WooCommerce orders and shows the results only to logged-in users who can view the WooCommerce order screens.

For developers

Filters:

  • rcfw_match_fields – which details to match on. An array of email, phone and account. Remove phone to match on email and account only.
  • rcfw_phone_digits – how many trailing digits identify a phone number. Default 10.
  • rcfw_list_limit – how many earlier orders the Customer history box lists. Default 10.
  • rcfw_order_was_returned – return true for an earlier order whose parcel came back undelivered. Shipping and courier plugins can use it to show a returned-parcel warning.

Example: flag orders that a courier plugin has marked as returned.

add_filter( 'rcfw_order_was_returned', function ( $returned, $order ) {
    return $returned || 'returned' === $order->get_meta( '_my_courier_status' );
}, 10, 2 );

Screenshots

Installation

  1. In WordPress, go to Plugins > Add New and search for “SoftSquare Returning Customer History”, or upload the plugin zip under Plugins > Add New > Upload Plugin.
  2. Activate the plugin. WooCommerce must be installed and active.
  3. Make sure WooCommerce High-Performance Order Storage is on: WooCommerce > Settings > Advanced > Features. It is the default for stores created with WooCommerce 8.2 or later.
  4. Open WooCommerce > Orders. The Customer column and the Customer history box appear straight away. There is nothing to set up.

FAQ

How does it decide two orders are from the same customer?

Two orders match when they share a billing email address, a billing phone number, or a customer account. Any one of the three is enough, because guests often reuse their phone number with a new email address, or the other way round.

Does it work with guest checkout?

Yes. That is the main reason it exists. Guest orders have no account, so WooCommerce’s own customer view cannot link them, but they still carry an email address and a phone number.

Do phone number formats matter?

No. Spaces, dashes, dots, brackets and a leading + are ignored, and only the last 10 digits are compared, so the local and international forms of the same mobile number match. You can change the number of digits with the rcfw_phone_digits filter.

I take phone orders in my own account. Will every order look like a repeat customer?

No. Accounts that can edit WooCommerce orders, such as administrators and shop managers, are ignored for matching. Those orders still match their real customers by email and phone.

Which orders are counted?

All of the customer’s earlier orders except drafts and trashed orders. Cancelled, failed and refunded orders are included on purpose, so you can see them.

Does it need High-Performance Order Storage (HPOS)?

Yes. The plugin reads WooCommerce’s order tables directly, which keeps it fast. HPOS is the default for new stores since WooCommerce 8.2. If your store still stores orders as posts, the plugin shows a notice and does nothing else.

Will it slow down my orders list?

No. It runs one small indexed query for each order on the screen, and only in the WordPress admin. Nothing runs on your store’s front end.

Does it store or send any customer data?

No. It only reads the orders already in your database and displays them to staff who can see orders.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“SoftSquare Returning Customer History” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.3.0

  • Renamed to SoftSquare Returning Customer History, with the slug softsquare-returning-customer-history, so it is clearly distinct from other plugins with similar names.

1.2.1

  • Plugin Check fixes: the order-history lookup is now a single fixed prepared query, and the short description is under 150 characters.

1.2.0

  • First public release on WordPress.org, as Repeat Customers.

1.1.0

  • Prepared for WordPress.org under SoftSquare.
  • New filters: rcfw_match_fields, rcfw_phone_digits, rcfw_list_limit and rcfw_order_was_returned.
  • Phone numbers with dots now match too.

1.0.1

  • Fix: orders placed by staff in their own account no longer match each other by that account.

1.0.0

  • First version: Customer history box on the order screen and the Repeat / New column in the orders list.