Commerce Server General - LineItem Quantity

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > June 2004 > LineItem Quantity





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author LineItem Quantity
Ken Brown

2004-06-20, 11:28 pm

Good afternoon,

Does anyone have an easy way to change the quantity of a line item from the
user's basket? I'm trying a number of different methods, as well as trying
the code from "Building Solutions..." w/ MSCS 2k2 book, and nothing seems to
be working.

TIA

Ken


Ken Brown

2004-06-20, 11:28 pm

Also, I should advise that I'm developing in C#.NET on an XP Pro system.
The databases are on a separate server. I'm also using a repeater (which I
don't care for) to display the user's basket and all the lineitems within
it.

Ken

"Ken Brown" <kbrown@nospamplease.formulaboats.com> wrote in message
news:eAGzFWKVEHA.1652@TK2MSFTNGP09.phx.gbl...
> Good afternoon,
>
> Does anyone have an easy way to change the quantity of a line item from

the
> user's basket? I'm trying a number of different methods, as well as

trying
> the code from "Building Solutions..." w/ MSCS 2k2 book, and nothing seems

to
> be working.
>
> TIA
>
> Ken
>
>



Vinod Kumar[MSFT]

2004-06-26, 10:49 am

Can you send me what you've tried so far and what error are you getting.
That way I'll be able to assist you better.

Thanks
-Vinod

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Ken Brown

2004-06-26, 10:49 am

Thanks for your response, Vinod, but I found a solution in Microsoft
eLearning cd on Commerce Server.
The code (for someone else who may need it) is:

string sCtl=""
OrderForm of = bskCart.OrderForms["default"];
foreach(LineItem li in of.LineItems)
{
sCtl = "OrderListing:_ctl0:CartListing:_ctl" + li.Index * 2 +
":QuantityContent";
li.Quantity = Convert.ToInt32(Request.Params[sCtl])'
}
bskCart.Save();
Response.Redirect("ShoppingCart.aspx");

This is part of a tutorial for Northwest Traders and, except for the "* 2",
worked just fine for my purposes. Now I just have to figure out how to
delete a lineitem when the quantity is set to zero without getting any
errors.

Thanks,
Ken

"Vinod Kumar[MSFT]" <vkumar@online.microsoft.com> wrote in message
news:9SdyAkbWEHA.308@cpmsftngxa10.phx.gbl...
> Can you send me what you've tried so far and what error are you getting.
> That way I'll be able to assist you better.
>
> Thanks
> -Vinod
>
> This posting is provided "AS IS" with no warranties, and confers no

rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com