Skip to content
Free & open source · Magento 2

Link the right guest order to the right customer.

Give authorised Magento administrators a deliberate, reviewable way to connect one eligible guest order to the exact matching customer account.

Access
Free and open source
Source version
v1.0.2
Package channel
Stable
License
MIT

Why it exists

The account exists. The earlier guest order is still missing.

When a shopper registers separately after guest checkout, Magento can leave the earlier order unassigned. Support needs a controlled way to fix that one record without turning an email match into automatic ownership.

Exact, scope-aware matching

Resolves the customer from the email already stored on the order and respects Magento's global or per-website customer sharing scope.

A deliberate Admin decision

Shows the action only for eligible orders and presents the resolved order and account for confirmation before anything changes.

Eligibility checked again

Revalidates the order, customer match, assignment state, scope, and permission immediately before linking.

Magento-native assignment

Uses Magento's customer-assignment service instead of direct SQL and refreshes only the affected sales grid records.

Concurrency and audit controls

Uses a per-order lock and adds a private history comment with the trusted Admin display name, without customer IDs or email addresses.

A deliberately small footprint

Adds no database tables, storefront assets, telemetry, external requests, bulk linking, or customer-facing linking endpoint.

Admin workflow

Review first, then assign one order

The visible action stays short while the server repeats the important checks immediately before the write.

1

Open the guest order

Magento shows Link to Customer Account only when the order is still unassigned and an exact eligible account exists.

2

Review the proposed link

The confirmation page shows the guest order and matched customer account before the administrator makes the permanent assignment.

3

Assign and verify

The module checks eligibility again, takes a per-order lock, uses Magento's native assignment service, and records a private audit comment.

Eligibility

Every requirement must pass

  • The Admin role has the dedicated Link Guest Order to Customer permission.
  • The order is still marked as a guest order and has no customer ID.
  • The order contains a customer email address.
  • An account with that exact email exists in the applicable sharing scope.

Safety boundaries

What the module intentionally does not do

  • No automatic historical or bulk linking.
  • No arbitrary customer ID or name-based selection.
  • No reassignment of an order that already belongs to a customer.
  • No changes to status, totals, payment, addresses, quote, or items.
  • No customer-facing linking endpoint, telemetry, or external requests.
  • No database tables, storefront assets, reindex, or static deployment.

Installation and compatibility

Supported Magento and PHP versions

The package constraints start with Magento 2.4.4-era components and PHP 8.1. Magento 2.4.6-p12 on PHP 8.3 has been runtime-verified, and Magento 2.4.7-p10 on PHP 8.3 has passed the clean CI suite. Test other compatible combinations in a disposable environment before production use.

MagentoPHP
2.4.7-p10 · CI verified8.3
2.4.6-p12 · verified8.3
2.4.4+ · Composer constraintMagento-supported PHP 8.1+

Before installing

Use a PHP version supported by your exact Magento release. Review existing order, customer, and Admin customisations, then back up the store and test the assignment workflow outside production first.

Stable v1.0.2 is available now

Install from Packagist or inspect the tagged source and verified ZIP on GitHub.

Recommended

Install with Composer

composer require haroone/module-link-guest-order-to-customer:^1.0.2

Alternative

Install the module manually

Place the complete module files in this directory from the Magento root:

app/code/Haroone/LinkGuestOrderToCustomer

Magento setup

Enable, register, compile, and clean

bin/magento module:enable Haroone_LinkGuestOrderToCustomer
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean

Run DI compilation in production mode. The module adds no database tables or storefront assets, so reindexing and static-content deployment are not required.

Existing installation

Update the Composer package

composer update haroone/module-link-guest-order-to-customer
composer show haroone/module-link-guest-order-to-customer
bin/magento cache:clean config layout block_html

For a manual installation, replace the entire module directory with the latest release ZIP instead of merging old and new files. Review the release notes before every update.

FAQ

What to know before installation

These answers cover the workflow, eligibility rules, and data boundaries that matter before adoption.

Does the extension automatically link every historical order with the same email?

No. It links one eligible order at a time after an authorised administrator reviews and confirms the exact assignment.

Can an administrator choose an arbitrary customer ID?

No. The server resolves the customer from the email already stored on the order and never trusts a submitted customer ID.

What happens when customer accounts are shared per website?

The customer must exist within the order website's applicable sharing scope. The module does not link the order across websites.

Can an order that already belongs to a customer be reassigned?

No. Existing customer assignments are rejected, and the same rule is checked again immediately before linking.

Does linking make the order visible in My Orders?

The assignment connects the order to the account. Storefront visibility still follows Magento's existing order-status visibility configuration.

Does the extension change the order itself?

It changes only the customer assignment. It does not change order state, status, totals, payment, addresses, quote, items, or global configuration.

Does installation require reindexing or static content deployment?

No. The module has no declarative schema and no storefront assets. Run setup:upgrade, compile DI in production mode, and clean Magento cache.

How do I update an existing Composer installation?

Update only haroone/module-link-guest-order-to-customer, confirm the resolved version with composer show, and clean the config, layout, and block_html cache types. Review the release notes before each update.

Support and engineering

Use the extension for the focused job. Bring the wider workflow when the store needs more.

For store-specific customer, order, checkout, integration, or migration work, share the real Magento context so compatibility and ownership boundaries can be reviewed first.