Microsoft .NET Server Solutions for the Enterprise

Web Site Support for Shopping Baskets

The implementation of a shopping basket Web page is largely a matter of Web site programming that is beyond the scope of Commerce Server itself, although the Retail Solution Site available on the Commerce Server Web site, and the .NET Retail Sample Site available in the Commerce Server 2002 SDK, provide working versions of such pages.

The Commerce Server 2000 Retail Solution Site contains several pages that correspond directly to the support for shopping baskets:

These pages call Commerce Server objects to load and save shopping baskets from and to the Transactions resource or database. In addition, the page basket.asp uses a Commerce Server pipeline to perform some error checking on the contents of the basket. See the next section, "Object Support for Shopping Baskets" for more information.

The ASP.NET-based International Retail Site, included in the Commerce Server 2002 SDK, defines both controls and classes that implement shopping basket/cart functionality for use within the Web site. This includes the control Cart, which is used to render the products currently in the cart. The Cart control and all of the other transaction controls are implemented in a pair of files of the same name, with HTML for the control defined in a .ascx file and the code for the control defined in a .ascx.vb file. Each control inherits from the class of the same name.

The namespace Microsoft.CommerceServer.Site.Transactions defines the classes corresponding to the transaction controls, as well as an additional supporting class. These classes access the Commerce Server shopping cart objects through the Commerce Server Base Class Library (BCL) namespace Microsoft.CommerceServer.Runtime.Orders, which defines more than a dozen classes including the class Basket that directly supports the notion of a shopping basket.

Previous  Next

Категории