Microsoft KB Archive/296306

= BUG: Retail Site Orderform.value(&quot;user_id&quot;) Is Not Renewed in New User's GUID =

Article ID: 296306

Article Last Modified on 9/24/2003

-

APPLIES TO


 * Microsoft Commerce Server 2002 Standard Edition
 * Microsoft Commerce Server 2000 Standard Edition

-



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(&quot;user_id&quot;, sNewUserID, sOrderFormName)

Next ' *     ' * END NEW CODE ' *

Call mscsOrderGrp.SaveAsBasket

' Remove the source basket. Set mscsOrderGrpMgr = GetOrderGroupManager Call mscsOrderGrpMgr.DeleteOrderGroupFromDisk(sSourceBasketID) End If End Sub



STATUS
Microsoft has confirmed that this is a problem in Microsoft Commerce Server 2000.



Steps to Reproduce Behavior

 * 1) Add the DumpOrder.vbs Scriptor Component to the Basket.pcf pipeline.
 * 2) Open the Retail site.
 * 3) Add items to the basket as a Guest user.
 * 4) Sign in as the user who has registered.
 * 5) Refer to the basket, and confirm that the items from step 2 are added.
 * 6) Check out. Notice that the user_first_name and user_last_name fields of the OrderGroup table are NULL.
 * 7) Open the log file that DumpOrder.vbs created. Notice that the [user_id] is the Guest user's GUID.

Additional query words: cs2k sites retail supplierad supplieractivedirectory errors incorrect

Keywords: kbbug kbpending KB296306

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.