Model

CustomerAssignment

Magento\Sales\Model\Order\CustomerAssignment

What it does

This class handles the assignment of a customer account to an existing order, typically used when converting a guest checkout order to a registered customer order.

Developers would use this when implementing customer registration after checkout or when linking orders placed as guest to newly created customer accounts.

It updates all customer-related fields on the order and dispatches an event for extension points.

Public Methods

  • execute()