View Single Post
  #22  
Old 04-03-2005, 12:38 PM
 
x-light x-light is offline
 

Member
  
Join Date: Mar 2005
Posts: 29
 

Default

Hi Speedmaster,

Quote:
It looks like this mod still allows anonymous checkout? How can a returning customer checkout anonymously if the email field is unique?

That's a good question. This relates to your second question. When a customer checks out anonymously, the mod will check to see if a his/her email exist in the customers table. If it does exist and it belongs to an anonymous user, it will first delete that specific record and create a new one with that email. However, if the email exist and it belongs to an registered user, the mod will set the eerror and an duplicate email error will be returned to the user. This should be safe since anonymous users only log in to place an order once and if they do place an order, a seperate order record is placed in the orders table.

Quote:
Also, let me know if I am understanding this correctly. When a customer enters his/her info during checkout, your mod creates the customer if the email is unique, but deletes it if it finds out the customer is checking out anonymously?

Actually, it only creates the record when the following is true as shown in the above answer.

Quote:
One more thing, our store has been live for a while so we have some customers. The last time I checked, we have up to 800 customers who have anonymously checked out more than once (in other words, we have a lot of duplicate emails). How can we remove or handle those?

Well I don't know exaclty what you want to do with this. However, if I understand you correctly, it sounds like you want to remove records that has duplicate emails. I think what you may need is a custom script which access the customers table outside x-cart and do some logic checking. However, since you are running a live store, I would definitely backup your entire database just in case if the script deletes the wrong records. You can whip up a script which retreives all anonymous customers from the customer table do perform the following logic:

1. store each records with with same email in an list of arrays
2. compare to see if the first_login time is newer than the previous one if exist if, so keep this record, else delete this record (this ensures that the emails should be most recent after all duplicate is removed)

That should be it, after you run a script which perform these logic, your customer table should have no duplicate emails along with the latest first_login time for each of them. Hope this helps.

~x-light
[/code]
__________________
X-Cart 4.xx Gold
Enterprise Linux
Reply With Quote