Query Regarding Discount ...

Hi

How to reflect discounts to the basket which is created through BizDesk?

This's how I've tried....

Basket basket=CommerceContext.Current.OrderSystem.GetBasket(new Guid(g));
LineItem li=new LineItem();
li.ProductID="11012";
li.ProductCatalog="WWStore";
li.ProductCategory="Kitchen Tools";
li.Quantity=20;

OrderContext orders = CommerceContext.Current.OrderSystem;

string filter = "enabled=1 and language_id='en-US'";
string[] columns = {"shipping_method_id","shipping_method_name"};
DataSet ds = orders.GetShippingMethods(filter,"shipping_method_name",columns);
OrderAddress addr = new OrderAddress("Shipping","Shipping");
OrderForm of;
if (basket.OrderForms.Count == 0)
{
basket.OrderForms.Add(new OrderForm("default"));
}
of = basket.OrderForms["default"];
of.LineItems.Add(li);
PipelineInfo pipeInfo = new PipelineInfo("basket",OrderPipelineType.Basket);
PipelineInfo pipeInfo1 = new PipelineInfo("checkout",OrderPipelineType.Checkout);
basket.RunPipeline(pipeInfo);
basket.RunPipeline(pipeInfo1);
basket.Save();
Label2.Text=basket.SubTotal.ToString();

ContentSelector cst=CommerceContext.Current.TargetingSystem.SelectionContexts["discounts"].GetSelector();
StringCollection sc=cst.GetContent();
foreach (string DisItem in sc)
{
Response.Write(DisItem);
}

I can able to retrieve the discounts from the bizdesk. But how to reflect the discount values in basket.

Kindly help me with Sample Code...

Thanks & Regards
Sam

[1700 byte] By [Sam.mca@gmail.com] at [2008-2-15]
# 1

Hi Sam,

ContentSelector pipelines won't apply discounts to you basket. You need to run Orders pipelines. The docs have lots of samples around the. See http://msdn2.microsoft.com/en-us/library/ms997230.aspx to get started.

Hope this helps,

David

DavidLott-MSFT at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2002 and Earlier...