I'm building an ecommerce site using AlphaSportsWeb as a guide or template and started testing it a few days ago (locally, only) prior to uploading it to it's new server home, and ran into this problem.
I really need some help and advice on this.
When a customer returns to the site after previously having made a purchase and gone through the process of registering as a new customer, he/she has the option of logging in, but it is not required. If a customer DOES log in, then they will be able to view their previous sales info, or auto fill the required customer information at checkout. This is good. However, if the customer chooses NOT TO LOG IN, at checkout, he/she can manually fill out all of the customer information as before, including email and password. At the end of the checkout process, a second record has now been entered into the customer table, identical to the first except for the customer id.
The problem is this; should that customer try to view his/her sales history, ONLY THE FIRST PURCHASE WILL SHOW UP because when the customer logs in with the correct user id (email) and password, the system looks ONLY AT THE FIRST RECORD having that email address, then checks to see the password in that record is the same as the password entered and returns the customer id for THAT RECORD ONLY. That will be the id used to filter the invoice header table to show the customer's sales history. The second, or third, or fourth etc. purchase (assuming they were also done the same way as above) will not show up because they were each assigned unique customer id's. Also, if the customer uses a different password for any of the purchases after the first, and tries to log in using that password, they will get an "Invalid user name or password" error, even though the user id and password are actually correct.
I'm new to the html environment and am really not sure how to go about resolving this. Is there a way of filtering on all the records for a specific email address, then filter the invoice header using all the customer ids for that email address? Or would it be better to check when the "Save and Continue" button is pressed at the time the Customer Information page is finished to see if there already exists a record in the customer table with that email address and advise the customer via a popup window or some other means that "There is already a registered Customer with that email address in the system" and stop there before a second record is entered into the customer table? I would think there are a lot of different ways of handling this, but I'm looking for something that will do it and still be simple enough for a newbie like myself to implement.
Thanks
Jim Smith
I really need some help and advice on this.
When a customer returns to the site after previously having made a purchase and gone through the process of registering as a new customer, he/she has the option of logging in, but it is not required. If a customer DOES log in, then they will be able to view their previous sales info, or auto fill the required customer information at checkout. This is good. However, if the customer chooses NOT TO LOG IN, at checkout, he/she can manually fill out all of the customer information as before, including email and password. At the end of the checkout process, a second record has now been entered into the customer table, identical to the first except for the customer id.
The problem is this; should that customer try to view his/her sales history, ONLY THE FIRST PURCHASE WILL SHOW UP because when the customer logs in with the correct user id (email) and password, the system looks ONLY AT THE FIRST RECORD having that email address, then checks to see the password in that record is the same as the password entered and returns the customer id for THAT RECORD ONLY. That will be the id used to filter the invoice header table to show the customer's sales history. The second, or third, or fourth etc. purchase (assuming they were also done the same way as above) will not show up because they were each assigned unique customer id's. Also, if the customer uses a different password for any of the purchases after the first, and tries to log in using that password, they will get an "Invalid user name or password" error, even though the user id and password are actually correct.
I'm new to the html environment and am really not sure how to go about resolving this. Is there a way of filtering on all the records for a specific email address, then filter the invoice header using all the customer ids for that email address? Or would it be better to check when the "Save and Continue" button is pressed at the time the Customer Information page is finished to see if there already exists a record in the customer table with that email address and advise the customer via a popup window or some other means that "There is already a registered Customer with that email address in the system" and stop there before a second record is entered into the customer table? I would think there are a lot of different ways of handling this, but I'm looking for something that will do it and still be simple enough for a newbie like myself to implement.
Thanks
Jim Smith