| Craig Boland 2004-11-08, 5:47 pm |
| I manually copied the user information from
CommerceContext.Current.UserProfile into each OrderForm. Since I was moving
from an anonymous basket to an authenticated basket, I had to ensure that
CommerceContext.Current.UserID had been set to the authenticated user ID and
also that CommerceContext.Current.AuthenticationInfo.SetProfileTicket had
been called. Otherise, CommerceContext.Current.UserProfile was null.
"Nihit Kaul [MSFT]" wrote:
> Hi,
>
> The Basket.Add(OrderTemplate) API will only copy over the LineItems from
> the source to the destination basket. No other information such as
> addresses etc. are copied over - I believe this was mainly done as a
> security consideration (the user information could have sensitive
> information that could get copied over if you are using
> Baskets/OrderTemplates from different users etc.
>
> Since your basket is already authenticated, I am assuming it has the user
> info in it. If not then you will have to add that in along with addresses
> etc.
>
> Hope that helps.
>
> Thanks,
>
> Nihit Kaul[MSFT]
> Commerce Server
> http://blogs.msdn.com/nihitk
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> --------------------
> Thread-Topic: Problem copying contents from anonymous basket to
> authenticated ba
> thread-index: AcS96whA6lDMTRsaT2yVtsnmwoLJDw==
> X-WBNR-Posting-Host: 198.22.121.120
> From: =?Utf-8?B?Q3JhaWcgQm9sYW5k?= <CraigBoland@discussions.microsoft.com>
> Subject: Problem copying contents from anonymous basket to authenticated ba
> Date: Fri, 29 Oct 2004 12:11:02 -0700
> Lines: 21
> Message-ID: <F5E13528-A59A-4E97-9140-4828FA1482B0@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> Newsgroups: microsoft.public.commerceserver.userprofilemgt
> NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
> Xref: cpmsftngxa10.phx.gbl
> microsoft.public.commerceserver.userprofilemgt:3180
> X-Tomcat-NG: microsoft.public.commerceserver.userprofilemgt
>
> My site allows customers to shop anonymously. When the customer is ready to
> check out, they must log in. If the customer already has a saved shopping
> cart, I give them the option to use the current basket (anonymous), the
> saved
> basket (authenticated), or merge the two together (authenticated). I am
> having a problem with the first option; using the current basket.
>
> At the time this decision is made, the user is logged in, so I have access
> to the saved basket. I also have access to the anonymous basket as an
> OrderTemplate, which I obtain by calling
> CommerceContext.Current.OrderSystem.GetOrderTemplate. My code then removes
> all of the OrderForm instances from the authenticated basket, then calls
> Basket.Add(OrderTemplate) on the authenticated basket to transfer the
> contents. The order contents are transferred, but the user information
> remains null after saving.
>
> I can always manually copy the user info property values, but I think this
> should be filled in automatically by the Basket (or something else).
> Otherwise, Basket.Add(OrderTemplate) is almost useless because it doesn't
> copy the contents correctly.
>
> Is there something else I need to do? Run a pipeline, or something?
>
|