Link Customer to an Order – Magento Extension

It happens all too often – one of your customers made a purchase on your Magento based website without first logging into their account.  Or they chose to not create an account but then later on changed their mind and wanted one.  The result here is an order without a customer – it’s marked as checked out as guest, and a customer account that is missing an order.

A quick bit of poking around in the Magento Admin proves to be a dead-end – a feature/function to allow you to connect the guest order with a customer doesn’t exist.  It is possible to connect the guest order to a customer through the database, but that obviously isn’t the best solution – I didn’t think it was wise to give my customer service team access to the database for them to update records.  So, for that reason I built an extension that will make this connection.

Magento Extension - Link Customer to Order
Magento 1.x Extension for linking a customer to a guest order

The extension is available on GitHub.  It was developed on Magento 1.6.2 CE, but should work on most any version.

Download the Magento 1.x Link Customer to Order Extension →

How the Magento 1.x Link Customer to Order Extension Works

Once the extension is installed, a new menu option will be added which gives you access to the main page where you will put in the order and customer information.  Enter the customers’ email address as well as the order number that should be linked.  Additionally, select the store that the customer is associated with (if running multiple stores).

Initiate a customer to order link in the Magento admin.
Enter the order and customer information to link the two together.

The next page will display the customer and order information.  This is a manual error checking step to ensure that allows you to ensure that you are making the proper connection.

There is also some automatic error checking here as well.  For example, if the order is already linked to a different customer an error will be displayed and the link can not be completed.  There are also checks that the customers email address matches a customer from the selected store, the store on the order and the customer match, etc.

Verifying the information is correct before linking the customer to the order
The customer information and the order information are displayed as a form of manual validation of the link Automated validation happens as well and will display an error message if any issues arise.

If everything looks good on the link preview, simply press the Process Link button and the customer can happily see their order in their account, as well as you can see the order linked to the customer in the Magento Admin.

Shortcut Buttons

To make the data entry process a bit quicker and easier, two buttons have been added elsewhere in the Magento Admin to initiate the linking of the order and the customer.

Customer View

When viewing a customer, a Link to Order button is added that will send you to the first step of the linking process with the customers email address and store pre-filled.

Order View

When viewing an order, a Link to Customer button will show as long as the order was placed by a guest.  Clicking this button will take you to the first step of the linking process with the order number pre-filled.