Saravanakumars38

Hi,

I am creating web application. i need to show Basket details in cartpage.

So i have decided to use BasketDatail control from startersite, but i don't understand anything about BasketDetail control.

Can any one help me to show the Basket using BasketDeatil control or any other method is avilable to show the Basket detail.

Thank you,




Re: Commerce Server 2007 How to display Basket details?

Agha Asif Raza

I dont know whether you are currently using the whole startersite for your implementation or just using the commerce components library in a separate project. Assuming your solution is not based on starter site, if you are able to place the basket detail control on a web page, all you are left to do is to pass the name of the basket (which you want to display) to this control along with the name of discounts cache.

The following code initializes the basket control to display basket named "MainBasket" of the current user:

this.BasketDetail.BasketName = "MainBasket";

this.BasketDetail.DiscountsCacheName = "Discounts" ;

Typically, you place the initialization code in the OnInit event handler of the page.

There is another property called 'SiteContext' in the basketDetail control which actually expects an implementation of ISiteContext interface that is part of the CommerceComponents Library. The StarterSite has an implementation of this ISiteContext interface. So if you are using starter site you can set the SiteContext property of the basketDetail control to SiteContext.Current which will enable the control to render links to the product details page for each product. If you dont have starter site you can either leave the SiteContext property of the control to null (the easy way) or create your own implementation of the ISiteContext interface and set it on the SiteContext property of the control. Leaving the property null will not display product name as a link to its details page rather just plain display name.

Hope this helps,

--

Agha