mohan-devstack / magento2-guest-order-to-customer
Map Magento 2 guest orders to an existing customer account with the same email, from a "Map to Customer" button on the admin order view page.
Package info
github.com/mohan-devstack/magento2-guest-order-to-customer
Type:magento2-module
pkg:composer/mohan-devstack/magento2-guest-order-to-customer
Requires
- php: ~8.1.0||~8.2.0||~8.3.0||~8.4.0||~8.5.0
- magento/framework: ^103.0
- magento/module-backend: ^102.0
- magento/module-config: ^101.2
- magento/module-customer: ^103.0
- magento/module-sales: ^103.0
- magento/module-store: ^101.1
- magento/module-ui: ^101.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Map a guest order to an existing customer account from the Magento admin. When a guest checks out with an email that already belongs to a registered customer on the same website, a Map to Customer button appears on the order view page; one click assigns the order to that customer so it shows up in their account.
Features
- Map to Customer button in the admin order view header, shown only for guest orders with a matching customer
- Matches by order email, scoped to the order's website
- Confirmation dialog showing the target customer's name, email and ID before mapping
- Uses Magento's native
Magento\Sales\Model\Order\CustomerAssignment - Adds an order history comment recording who mapped the order
- Dedicated ACL resource (
Mohan_GuestOrderToCustomer::assign) so you control which admin roles can map orders - Enable/disable per store view
Requirements
- Magento 2.4.4 or later
- PHP 8.1 or later
Installation
Via Composer (recommended)
composer require mohan-devstack/magento2-guest-order-to-customer php bin/magento module:enable Mohan_GuestOrderToCustomer php bin/magento setup:upgrade php bin/magento cache:clean
Manual
- Copy the module to
app/code/Mohan/GuestOrderToCustomer/ - Run:
php bin/magento module:enable Mohan_GuestOrderToCustomer php bin/magento setup:upgrade php bin/magento cache:clean
Configuration
Stores > Configuration > Mohan > Guest Order to Customer
| Field | Description |
|---|---|
| Enable | Show the Map to Customer button and allow mapping (default: Yes) |
Usage
- Go to Sales > Orders and open a guest order
- If a customer account exists with the same email on the order's website, click Map to Customer in the page header
- Confirm the dialog — the order is assigned to the customer and a comment is added to the order history
Permissions
Grant Sales > Operations > Orders > Actions > Map Guest Order to Customer to admin roles that should be able to map orders.
Support
- Email: mohandevstack@gmail.com