HomeHome Product Discus... Product Discus...SmithCartSmithCartThe relationship between the DNN Profile and the Smith_Customer tableThe relationship between the DNN Profile and the Smith_Customer table
Previous
 
Next
New Post
12/22/2009 3:49 PM
 

What is the relationship between your CustomerId and the DNN userId. Do you generate customerId for each transaction?

The customerid in the smith_customer table is an identity column. The field in the smith_customer table that links the customer with the dnn profile is called dnnloginid. If the user is logged into DNN and places an order then the smith cart will recognize it and will use the dnn profile already created, if user is not logged in then smith cart will create a new dnn profile and generate unique customerid in the smith_customer table for the transaction.


At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
7/8/2010 12:28 PM
 

This appears to be not quite correct. The Smith_Customers table has a column called DNNLogin -- but it gets populated with the logged-in user's email address, not the Username value from the DNN Users table. The Smith_AddCustomer and Smith_GetCustomer stored procedures don't do any joins to the Users tables, so I can't tell how the code populates the @Login parameters of those stored procedures. I couldn't find any stored procs that handle the lookup/matching logic, so I assume it's hard wired into the code.

This might cause some grief if multiple DNN users had the same email address (possible if there are multiple portals on the same server).

 
New Post
7/8/2010 1:06 PM
 

This turns out to be a serious problem if you need to figure out the DNN User that corresponds to a Smtih_Customer, It IS possible to have multiple DNN users with the same email address, even on the same portal. To make matters worse, the Smith_Customers.DNNLogin column sometimes gets the Users.UserName and other times gets the Users.Email value. It depends on whether the user registered at the site during a cart purchase sequence, or had registered at the site on a separate occasion. It is therefore impossible to compose a query that returns a unique Users.UserID value given the Smtih_Customers.CustomerID value.

This is a bug -- the cart should always use the DNN UserName value for the Smith_Customers.DNNLogin column. The UserName value is guaranteed to be unique (for a given portal).

 
New Post
7/8/2010 3:38 PM
 

There a multiple scenarios when a user purchases from the cart and the email address is only populated in the dnnlogin field of the customer table for one scenario:

 

Scenario 1

If the user already has a dnn account and they are logged in when they checkout then the cart will save their current userid in the dnnlogin field in the smith_customer table.

 

Scenario 2

If the customer is not logged in then the cart and you have enabled the login on the confirm page the the cart will use whatever the user types into the login textbox on the confirm page as their dnnlogin and saves what the user entered in the dnnlogin field in the smith_customer table and creates a new dnn account in the portal using what the user typed in. See the following code:

 

if(!String.IsNullOrEmpty(txtLogin.Text))
customer.DNNLogin = txtLogin.Text;
else if (HttpContext.Current.User.Identity.IsAuthenticated)
customer.DNNLogin = UserInfo.Username;

 

I think this is the scenario that is causing the confusion. If you have configured the cart to show the login/password on the confirm page and the user is not logged in the cart pre populates the login textbox with the email they entered on step 1 of the checkout. The user has the option of accepting the email that was pre populated in the userid text box and just typing in the password or they can type in any userid they want in the in the user id textbox. In this scenario if they choose to accept the default email that was populated and just type in their password then the cart will populate the dnnlogin in the customer table with their email and create a new dnn account using their email as their userid.

 

Scenario 3

If the customer is not logged in and you have not enabled the show login on the confirm page then the cart doesnt save anything in the dnnlogin field in the customer table. The user has checked out anonymously in this case.

 

Scenario 4

In the cart settings under the generate cart setup section if you have checked "Show Login Screen" when the user checks out if they are not logged in already then when they click the checkout button on the cart screen they will be presented with the login page that prompts them with the following depnding if you have chosen the option to require login:

 

Scenario 4-1

If requre login checked in cart settings then the user has these 2 option on the login page:

1. Create an account - If the user creates an account by typing in their desires userid and password then the the cart will use whatever the user types into the login textbox as their dnnlogin and saves that to the dnnlogin field in the smith_customer table and creates a new dnn account in the portal using what the user typed in.

 

2. Login - If the user already has a dnn account on your portal and they log in here then the cart will save their current userid in the dnnlogin field in the smith_customer table when they checkout.

 

Scenario 4-2

If requre login checked is NOT checked in cart settings then the user has these 2 option on the login page:

1. Checkout anonymously - If the user chooses to check out anonymously then the cart doesnt save anything in the dnnlogin field in the customer table.

 

2. Login - If the user already has a dnn account on your portal and they log in here then the cart will save their current userid in the dnnlogin field in the smith_customer table when they checkout.


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
7/9/2010 8:36 AM
 

First, let me say how much I appreciate the prompt, thoughtful responses Scott provides in these forums. Your service is excellent.

This post is long and detailed, because I need to explain exactly what the problem is. I have spent a lot of time testing this, and my results partially contradict the scenarios Scott described. Before jumping into the detail, here's the executive summary. The cart settings are:

General Cart Setup: Show Login Screen – checked.
Confirmation Page Setup (Before Payment): Require Login: checked; Hide Login and Password: checked.

if a first-time visitor registers on the Welcome screen of the checkout sequence, everything is fine. But if a first-time visitor registers using the normal DNN skin "Register" link at the top of the page, the cart is broken, and will spawn new CustomerIDs every time that user places an order.

Here's the detailed walk-through:

Smith.BuyNow Settings
General Cart Setup: Show Login Screen – checked.
Confirmation Page Setup (Before Payment): Require Login: checked; Hide Login and Password: checked.
Scenario A – new user – registers during checkout process.
A.1 – first time at site.

1. Hit site. Do not log in.
2. Add item to cart. Checkout, Checkout.
3. Welcome screen. Create an Account / Sign in to Your Account – all fields blank.
4. Fill in username of abc, password, and confirm password. Continue.
5. On Ship screen, fill in all blanks. Use email address of abc@myofficetraining.com (a valid email address). Next.
6. On Pay screen, supply valid CC information. Next.
7. On Confirm screen, everything looks fine. Click Submit Order.
8. Thank You! Your order is confirmed. Order ID: 21. Shipping and billing information all as entered earlier. Close.
9. Logout.
In Smith_StoreOrders table, there is a new row with OrderID = 21, CustomerID = 13 (new), shipping info correct.
In Smith_Customers table, new row CustomerID = 13, DNNLogin = abc. Note: this is correct: it is not the email address. The email address is correctly recorded in the Smith_Customers.Email field.
In Users table, new row, UserID = 10, Username = abc. Blanks for FIrstName, LastName, and Email fields.
A.2 – subsequent visit to site.
Restarted IIS on the server. Logged off and logged back onto workstation PC.
1. Hit site. Logged in with username abc before using cart.
2. Add item to cart. Checkout, checkout.
3. Ship screen – all fields correctly populated.
4. On Pay screen, provide valid CC information. Next.
5. Confirm screen looks fine (no login area showing). Submit Order.
6. Thank you. Order ID: 22.
7. Logout
Smith_StoreOrders table, new row OrderID = 22, CustomerID = 13 (correct). Other fields identical to previous row.
Smith_Customer table – no new row, values unchanged for CustomerID = 13. Users table, no new row, values unchanged for UserID = 10.
Scenario B – new user, registers before using cart
B.1 – First time at site

1. Hit site. Click Register.
2. User Name: xyz
3. First name: Xerxes, Last Name: Zapata, Display name: Xerxes Zapata, email: xyz@myofficetraining.com (a valid email address), provided password.
4. Click Register. DNN skin shows correct user name (Xerxes Zapata) at the top.
5. Add to cart, Checkout, Checkout.
6. Ship screen pre-populated with First Name, Last Name, and email (xyz@myofficetraining.com).
7. Filled in other fields, Next.
8. Filled in CC info. Next, Submit Order.
9. On Confirm screen, everything looks fine. Click Submit Order.
10. Thank you. Order ID: 23
11. Logout.
Smith_StoreOrders, new row, OrderID = 23. CustomerID = 14 (new). Ship info correct.
Smith_Customer table, new row CustomerID = 14. DNNLogin = xyz@myofficetraining.com. This is wrong. The user was a registered site user (steps 1 – 4). The DNNLogin should have been xyz.
Users table, new row UserID = 11, all fields populated as per registration sequence. Username = xyz, email = xyz@myofficetraining.com.
B.2 – Subsequent visit to site.
Restarted IIS on the server. Logged off and logged back onto workstation PC.
1. Hit site. Logged in with username xyz before using cart. DNN skin shows correct user name (Xerxes Zapata) at the top.
2. Add item to cart. Checkout, checkout.
3. Ship screen – Only First Name, Last Name and Email are pre-populated. Had to fill in address, city, etc. Why didn’t it remember this from last time?
4. On Pay screen, provide valid CC information. Next.
5. Confirm screen looks fine. Submit Order.
6. Thank you. Order ID: 24.
7. Logout
Smith_StoreOrders, new row OrderID = 24. CustomerID = 15 (!). This is wrong. It should be CustomerID 14. The code has created a new customer when it should have used the existing customer 14.
Smith_Customer, new row CustomerID = 15. DNNLogin = xyz@myofficetraining.com. Note: all the fields for CustomerID 15 are identical to CustomerID 14.
B.3 – A third visit to the site by user xyz
Restarted IIS on the server. Logged off and logged back onto workstation PC.
1. Hit site. Logged in with username xyz before using cart. DNN skin shows correct user name (Xerxes Zapata) at the top.
2. Add item to cart. Checkout, checkout.
3. Ship screen – Only First Name, Last Name and Email are pre-populated. Had to fill in address, city, etc. Why didn’t it remember this from last time?
4. On Pay screen, provide valid CC information. Next.
5. Confirm screen looks fine. Submit Order.
6. Thank you. Order ID: 25.
7. Logout
Smith_StoreOrders, new row OrderID = 25. CustomerID = 16 (!). ARRGGHH! The code is creating a new customer every time xyz buys something having first logged into the site.
Smith_Customer, new row CustomerID = 16. DNNLogin = xyz@myofficetraining.com. Note: all the fields for CustomerID 16 are identical to CustomerID 15 and 14.
B.4 – A fourth visit to the site by user xyz
Restarted IIS on the server. Logged off and logged back onto workstation PC.
This time, user xyz won’t log in until the shopping sequence has begun.
1. Hit site. Did NOT log in before using cart.
2. Add item to cart. Checkout, checkout.
3. Welcome screen. Create an Account and Sign In to Your Account panels have blank fields. Filled in the Sign In to Your Account UserName = xyz, password, clicked Sign In. DNN skin shows correct user name (Xerxes Zapata) at the top.
4. Ship screen – Only First Name, Last Name and Email are pre-populated. Had to fill in address, city, etc.
5. On Pay screen, provide valid CC information. Next.
6. Confirm screen looks fine. Submit Order.
7. Thank you. Order ID: 26.
8. Logout
Smith_StoreOrders, new row OrderID = 26. CustomerID = 17 (!). The code has again created a new customer.
Smith_Customer, new row CustomerID = 17. DNNLogin = xyz (!!!) Somehow, the code has recognized the Users.Username value for the logged in user when the user logs in at the cart Welcome screen, but does not pick it up if the user logs in via the usual DNN skin Login link before starting a buying sequence.
I repeated B3 (log in before shopping sequence) for this same user to see if the cart would recognize the user and stop generating new Customers. This time the Ship screen was fully populated (a good sign). Sure enough, the new orderID = 27 uses CustomerID 17 – the same one as last time. By loggin in during the checkout sequence, the problem has been cured.
Conclusions
Scenario A works. If a first time visitor registers during the checkout sequence, then the code recognizes that customer properly on future visits, and does not generate bogus new customers. But the code ought to populate the Users table with the user’s first name, last name and email address. This is not fatal, but if the user later goes in edits their profile, they might be surprised to see that they have no name or email address.
Scenario B is broken. If a first-time visitor registers before starting a shopping sequence, the cart will spawn a new customer ID for that user every time they place an order. The only way out of this is for the user to hit the site, do not log in, start shopping, and log in on the Welcome page of the checkout sequence. This cures the problem, and the cart will recognize the user correctly henceforth.
This is a problem for any site that provides extra content for logged in users. The user will normally go to the site, log in, then start using the site. At some point, they decide to buy something. Having already logged in, the cart will fail to recognize the returning customer, and will create a bogus new customer every time the user orders something.
The bug appears to be related to how the code populates the DNNLogin field. If a user is logged into the DNN site by the time the order is completed, the code should use the Users.Username value, which is easily available via the DNN framework. It should not matter when the user logs in – log in before shopping, registers during shopping, or log in during shopping. When the cart completes the order, it should simply ask the DNN framework for the logged in Username, and use that. The only time it should use an email address for the DNNLogin value would be when the site owner has configured the cart to allow shopping by non-registered visitors.

 
New Post
7/9/2010 3:50 PM
 

I have read thru your reply and thank you for your detailed answer outlining the different scenarios. It will take me a bit of time to test out all the scenarios and try to replicate what you are describing. I should have an answer back to you this weekend sometime. Have a great weekend!

-Scott


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
7/13/2010 2:40 PM
 

After some testing I was able to confirm your conclusions for scenario B. Our programmers have fixed the issue and the hotfix titled "Confirm.ascx-2.97.zip" is availible on the downloads page. To deploy just copy the dll in the zip to your \bin folder.

Thanks for reporting this!!

-Scott


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
7/14/2010 8:38 AM
 

Upgraded to 2.97 and then copied the dll from Confirm.ascx-2.97.zip into the bin directory.

Scenario A.1 (register during cart sequence). I get to the Ship screen, fill in the info, then click Next. It then shows a blank page: nothing but my skin, menu bar, etc. But nothing inside it. The URL is http://MySiteBaseAddress/Catalog/tabi.... But it's completely blank.

Waaaaaah!

 
New Post
7/14/2010 8:43 AM
 

Clarification -- the blank screen behavior occurs immediately after the Ship screen for zero-price items, and immediately after the Pay screen for non-zero price items. And it appears to be the same for both Scenario A and Scenario B.

 
New Post
7/14/2010 1:10 PM
 

Thanks fro the clarification I will test this out and let you know if I can replicate the issue.

-Scott


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
7/27/2010 2:31 PM
 

Did this get resolved in a version higher than 2.97 (my current installed version)?

 
New Post
7/28/2010 1:08 PM
 

I am not able to replicate this on my test system but there are many different configuration options and I may not have my system configured exactly the way you do. Please login to our test site and try to replicate the issue so we can verify if it’s the build or your site:

Here is the link to our demo site:

http://www9.smith-consulting.com/

-Scott


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartThe relationship between the DNN Profile and the Smith_Customer tableThe relationship between the DNN Profile and the Smith_Customer table