We have a client who wants to allow anonymous checkout, but not the duplicate email address. He doesn't want customers to get the "Already Existing Account" message and be locked out. Also there is limited budget for an implementation.
After much thinking and examining of the source code, I think I may have come up with an approach.
Create a SQL Server Batch job to update the Customer Tables email address with a
bogus address for customers created with anonymous orders.
Declare @CustomerCnt Integer
select @CustomerCnt= count(*) from orders o
inner join Customer c on o.CustomerID=c.CustomerID
where c.IsRegistered=0 and patindex('%bogus123456789.com%',c.email)=0
and isnull(c.FirstName,'')='' and isnull(c.LastName,'')=''
if ISNULL( @CustomerCnt,0)>0
begin
update Customer set Email= convert(varchar(100),c.customerid)+'@bogus12345678 9.com'
from customer c
inner join Orders o on o.CustomerID=c.CustomerID
where c.IsRegistered=0 and patindex('%bogus123456789.com%',c.email)=0
and isnull(c.FirstName,'')='' and isnull(c.LastName,'')=''
end
The batch job could be set to run periodically (say once every 5 minutes). Does anyone know any downsides to this approach? I know during the interval between updates, a shopper can get the "Already Existing Account" message and that the Order->Admin->Change Email function updates the Customer and Order records.
Thanks,
John