BUG: Retail Site Orderform.value("user_id") Is Not Renewed in New User's GUID (296306)
The information in this article applies to:
- Microsoft Commerce Server 2002
- Microsoft Commerce Server 2000
This article was previously published under Q296306 SYMPTOMS
When a user browses to the Retail solution site as a Guest user, adds a product to his or her basket, and signs in with an account that the user previously created, the sale is recorded in the OrderGroup, OrderFormHeader, and OrderFormLineItems tables in the Transaction database after the user completes the purchase.
However, the OrderGroup and OrderFormHeader tables contain the following anomalies:
- The OrderGroup table contains NULL values for user_first_name and user_last_name, even though the user has entered these values in the Profile.
- The OrderFormHeader table does not contain the user_id of the Registered user.
CAUSE
This problem occurs because the user_id value is not properly updated at the OrderForm level; it contains the Guest user's globally unique identifier (GUID) rather than the Registered user's GUID.
RESOLUTION
To resolve this problem, replace Sub MoveBasketItem in retail/login/login.asp with the following code:
Sub MoveBasketItems(ByVal sSourceBasketID, ByVal sDestinationBasketID)
Dim mscsOrderGrp, mscsOrderGrpMgr
Dim sNewUserID, sOrderFormName
' The source basket must exist and contain at least one item.
Set mscsOrderGrp = LoadBasket(sSourceBasketID)
If mscsOrderGrp.Value(TOTAL_LINEITEMS) <> 0 Then
' Add the items in the source basket to the items in the destination basket.
Set mscsOrderGrp = LoadBasket(sDestinationBasketID)
Call mscsOrderGrp.AddItemsFromTemplate(sSourceBasketID)
' *
' * BEGIN NEW CODE
' *
sNewUserID = sDestinationBasketID
For Each sOrderFormName In mscsOrderGrp.Value(ORDERFORMS)
Call mscsOrderGrp.PutOrderFormValue("user_id", sNewUserID, sOrderFormName)
Next
' *
' * END NEW CODE
' *
Call mscsOrderGrp.SaveAsBasket()
' Remove the source basket.
Set mscsOrderGrpMgr = GetOrderGroupManager()
Call mscsOrderGrpMgr.DeleteOrderGroupFromDisk(sSourceBasketID)
End If
End Sub
STATUSMicrosoft has confirmed that this is a problem in Microsoft Commerce Server 2000.
Modification Type: | Major | Last Reviewed: | 9/24/2003 |
---|
Keywords: | kbbug kbpending KB296306 kbAudDeveloper |
---|
|