Using the eCommerce Server Controls

Ektron provides a complete set of eCommerce server controls that let you set up an online marketplace where customers (site visitors) can purchase merchandise, services or content. Customers interact with these server controls on your site to:

Overview

Most eCommerce server controls let customers move from one control to another via template properties that let you define the location of another server control. For example, if you define the path to the Cart server control in the Product server control’s TemplateCart property, customers are directed to the Cart control when they click the Product control's Add to Cart button.

Ektron’s server controls let you insert standard methods and properties within the Visual Studio 2005 environment. This means that you can see the effect of your changes in real time; you don’t have to modify a page and then compile to see results.

You can insert server controls using drag and drop or programmatically. You can also use databinding to retrieve and display data from Ektron.

Ektron provides a complete set of eCommerce server controls that let you set up an online marketplace where customers can purchase merchandise, services or content. Customers interact with these server controls on your site to perform the the following tasks:

The following table shows typical actions a customer might perform when visiting your eCommerce site and how you can facilitate these actions.

Customer Action

How you accomplish this

When to Use

View account information

Create a link in the master page that leads to the template containing the MyAccount server control.

This link should be available from any page.

View previous and current orders

Create a link in the master page that leads to the template containing the OrderList server control.

This link should be available from any page.

Change the currency type

Add the CurrencySelect server control to a master page.

This server control should be available from any page.

Search for products

Either create a link to the template containing the ProductSearch server control.

- Or -

On the master page, add a textbox that passes the text to a hidden ProductSearch server control and post the results to a separate template.

This link or textbox should be available from any page.

View a list of products

Create a template that contains the ProductList server control. This template might be the first page customers see when they view the eCommerce portion of your site.

Whenever you want to display a list of products based on a catalog, taxonomy or a list content IDs. For example, you could create a list of products in a panel on the right side of your Web site.

View a product’s details

Create a template that contains the Product server control. Set any of the following server control’s TemplateProduct property to the path of this control. This makes a product’s title being displayed by one of these controls a clickable link that takes the customer to this control.

  • ProductSearch
  • ProductList
  • OrderList
  • Cart
  • Recommendation

When ever a customer needs to view details of a product.

View additional products associated with another product

Add the Recommendation server control to a template that contains a Product server control and set the Recommendation control’s DynamicProductParameter property to the QueryString parameter that’s used to pass a products ID.

When ever you want to present a customer with cross-sell and upsell opportunities associated with a given product.

Add a product to their shopping cart

Set the TemplateCart property in the following server controls to the path of the Cart server control. Setting this property is one of the requirements for the Add to Cart button or link to appear in these controls.

  • ProductSearch
  • ProductList
  • Product
  • Recommendation

NOTE: In addition to setting the above property, a product must be in-stock, not archived and buyable. Otherwise, the Add to Cart button or link does not show for a product.

When you want to allow customers to add products to their shopping cart.

View products in their shopping cart

When a customer adds a product to their cart, they are sent to the Cart server control. You should also create a link in the master page that leads to a template containing this control.

The link should be available from any page.

Checking out and paying for their selected product.

Add the Checkout server control to a template and add that template’s path to the Cart server control’s TemplateCheckout property. When you do, the Checkout button in the Cart server control becomes active.

You must set this up for customers to checkout.

Using eCommerce server control events

Using eCommerce Server Control Events

The eCommerce server controls contain event hooks that let you customize or manipulate them.

To use these event hooks, create a handler for each needed event in the code-behind of the ASPX page that contains an eCommerce server control. Then, in that page’s OnInit method, hook each event.

Event

This Hook is Called...

Description

PhaseChange

(Used only in the Checkout server control)

when the current phase is about to change.

Supervise phase changes and allow or prevent changing as needed. It also lets you jump to a specified phase. For example, you could jump to a passed phase, prevent the phase from changing from the current one under certain conditions, or jump to a phase that is not necessarily the next one in line.

PreProcessXml

immediately before the control’s XML is transformed.

Inspect or manipulate the server control’s XML before being processed.

This is the only time the XmlDoc property should be used to access the controls XML.

PostProcessXml

immediately after the control’s XML is transformed.

Work with processed transformed XML output inside the Text property before sending it to the browser. This allows simple string manipulation of the server control’s markup.

FilterAjaxCallback

when an Ajax-Callback event occurs.

Inspect or modify callback parameters. For example, you could use this event to receive custom values entered in a page.

PostLogin

(Used only in the Checkout server control)

immediately after a (possibly new) user logs in with this control

Calls custom code immediately after a returning user logs in with his email and password. Or, immediately after a new customer fills out the billing info screen. For example, you could add code that allows new customers to sign up for Web Alerts after they add their information to the billing screen.

Using the EkItems Property with eCommerce server controls

Using the EkItems Property with eCommerce server controls

You can use the EkItems property only with the Product and ProductList eCommerce server controls. This property gets EntryData for a product and can only be called during the PreProcessXml or PostProcessXml event. If used outside of these events, it returns empty values for the entry data.