src/Extension/MemberExtension.php
public function afterMemberLoggedIn()
    {
        if (Member::config()->login_joins_cart && $order = ShoppingCart::singleton()->current()) {
            $order->MemberID = $this->owner->ID;
            $order->write();
        }
    }
public function afterMemberLoggedIn()
    {
        if (Member::config()->login_joins_cart && $order = ShoppingCart::singleton()->current()) {
            $order->MemberID = $this->owner->ID;
            $order->write();
        }
    }
Link the current order to the current member on login,
if there is one, and if configuration is set to do so.