The Order Process and Related Server Controls
This section summarizes the shopper experience using Ektron's eCommerce feature and describes the Cart and Checkout server controls used to implement the order process.
NOTE: Shoppers have the option of checking out using PayPal’s checkout system. Order information is exported, and you can use your PayPal account to fund the purchase. See Also: Payment Options.
An order invoice page displays to confirm the order. If the order was for a subscription or downloadable software, additional information appears.
The Cart server control lets a customer (site visitor) select products to purchase; an online "shopping basket." Products are added to the cart when the customer select them.
A customer typically reaches the Cart server control from a product description or list page. A product description page contains a Product Server Control. Product list pages contain server controls that create a list of products, such as ProductList, ProductSearch or Recommendation controls. These controls contain a button or link that allows a customer to add the product to the cart.
You could also create a link to the cart from a master page or menu that lets customers view their cart. This link lets a customer navigate directly to the cart when they arrive at your site.
The Cart server control consists of 2 major areas. The top part (My Cart) represents the cart with which the customer is currently working. The bottom (My Saved Carts) represents a visitor’s saved carts. Saved cart information appears only when a customer is logged in. See Also: Creating a New Cart.
The My Cart area displays the Item, SKU, Quantity, List Price, Sale Price, Subtotal and Total. From this cart, a customer can remove items, update the quantity and subtotal information, apply coupons and check out. The customer can also choose to continue shopping or empty the cart.
The My Saved Cart area contains a list of carts the customer has saved and are awaiting checkout. This allows the customer to select products and save them for future purchase. This area contains:
- delete a saved cart
- create a new cart
- continue shopping
Clicking a saved cart makes it the current cart, and displays its products in the Your Cart area. A customer can then proceed to check out.
This section explains how a logged-in customer would use the Cart server control. The following figure helps you locate key features of the Cart.
Items are added to a cart when a customer clicks Add to Cart in the following server controls.
When Add to Cart is clicked, the item is appended to the current cart’s list of items. If the customer does not have a cart, one is created.
A customer automatically creates a new cart the first time a product is added to it. If needed, a customer can create multiple carts while using the Cart server control. This allows for the grouping of products being purchased. For example:
To create a new cart:
When the customer clicks OK, the cart is added to the list of Saved Carts and becomes the active cart. A customer can then click Continue Shopping to select products to add to the new cart.
In the Cart server control, a product’s title is a link. When clicked, it takes you to the product’s detail page. To navigate back to the cart, click your browser's Back button.
By default, the server control uses the product’s QuickLink information to provide a path to the product. You can override this functionality by adding a new path to the TemplateProduct property.
Assigning a name to a cart makes it easier for customers to identify a cart in their saved cart list. A customer can assign or change the name of a cart by clicking Edit () next to the cart’s name.
When clicked, the button and name are replaced with a text box that allows the customer to enter a new name for the cart.
To change a product’s quantity, enter the new amount in the Quantity column’s textbox, located in the same row as the product you want to change. Next, click Update Subtotal. This recalculates the price of the product and updates the subtotal. The image below shows the Atrium Table quantity change to 3.
A customer can continue to shop by clicking Continue Shopping. This redirects the visitor to a template defined in the cart server control’s TemplateShopping
property. For example, you might send the customer to a page containing a ProductList or ProductSearch server control. See Also: ProductList Server Control and Product Search Server Controls.
As a developer, you need to add the path to this page to the TemplateShopping
property. If the page is in the same folder as the page that contains the Cart server control, just enter the page’s name.
If coupons are defined in the Workarea and the EnableCoupons
property is set to True, a customer can enter coupons to discount the purchase. How coupons affect the purchase is defined in the Workarea > Settings > Commerce > Catalog > Coupons. See Also: eCommerce Coupons
To apply a coupon, a customer clicks Apply Coupon.
The button area changes to text box where the customer can enter the Coupon Code. The customer then enters a code and clicks OK. Next , the discount appears above the Subtotal, and the customer can continue to shop, check out, view other carts, or delete the coupon by clicking Remove Coupon.
When a customer is satisfied that the cart contains all products they want, the quantity of each product is correct and all coupons have been applied, the customer can click Checkout. At that point, the customer is redirected to the page that hosts the Checkout server control. The path to the page is defined in the TemplateCheckout
property. If the page containing the Checkout server control is in the same folder as the Cart server control, just enter the page name.
If a cart includes an item that is out of stock, the Checkout button is disabled (hidden).
The Cart server control has the following Ektron-specific properties. Native .NET properties such as font, height, width and border style are not described. For documentation of these properties, see Visual Studio® help.
Indicates if you are logged into the CMS Explorer and can use it to browse to content, collections, and so on. See Also: Browsing Your Ektron Site Using CMS Explorer.
Lets you inject custom XML into the generated XML before being processed by the XSLT. Enter a string of XML that you want to make available to the XSLT as follows:
<root><customXml>custom-xml-inserted-here</customXml></root>
See Also: Displaying Custom XML in Ektron’s Server Controls.
Cart.xsl
. This file is located in <siteroot>\Workarea\Xslt\Commerce.
IMPORTANT: If you specify an external file, do not store this file in the Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
See Also: eCommerce Coupons.
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
ajaxloader_circle_lg.gif
. This file is located in siteroot\Workarea\images\application
.siteroot\Workarea\csslib\Commerce
IMPORTANT: If you want to edit this file, make a copy, change its name and move it outside of the Workarea folder. If you make changes to this file and do not move it out of the Workarea, this file and the changes will be lost when you upgrade.
When this property is left blank, the server control uses the Product’s QuickLink information.
If the template file is located in the same folder as the Web form containing this server control, just enter its name. The path can be relative or absolute. See Also: Displaying an Item’s Information.
For information the ProductSearch or ProductList server controls, see Product Search Server Controls or ProductList Server Control.
IMPORTANT: When using the Checkout server control, your Web site should have an SSL certificate installed. Set its IsSSLRequired
property to True. This protects your customers’ payment information during transmission. Do not use a self-signed SSL certificate—obtain one from a trusted certificate authority.
The Checkout server control lets a customer navigate through the checkout process. This process includes:
Customers typically arrive at this server control by clicking Checkout on the Cart server control. They also might reach this server control from a Checkout link you create on your site.
The control provides a navigational aid that indicates the customer's step in the checkout process. At any point, the customer can move forward to the next step or back to a previous one. When appropriate, some steps do not appear. For example, if merchandise is not tangible, the shipping screen does not appear.
The login portion of the Checkout server control accommodates these types of customers.
If an existing customer is not logged in when the customer reaches this server control, it prompts him to log in. Optionally, this screen could have a link that allows an existing user to recover his password. To enable this link, add a template path to the control's TemplateRecoverPassword
property.
After a customer who previously purchased from this site logs in, billing and shipping information is retrieved and appear by default. The visitor can review and edit this information. However, Ektron does not store credit card numbers, so that information must be entered each time.
If a customer has not purchased from your site before and wants to set up an account, the customer clicks Create Profile and Checkout. On the new screen, the customer enters billing information including a password. After completing that screen, a membership user account is created, and the customer is logged in. The new user can then proceed through the checkout. The next time this visitor logs in, the customer is treated as an existing customer.
The Checkout server control provides a guest checkout feature (circled below) for customers who don't want to set up an account on your site. To enable this feature, set the AllowGuestcheckout
property of the Checkout server control to true
.
If a user clicks Checkout Without Profile, the customer proceeds to a version of the billing screen that does not ask for a password. The rest of the checkout is the same.
Although the customer can proceed through the checkout like other customers, if the customer wants to checkout in the future, the customer must re-enter billing and shipping information. Customers who use the guest checkout feature can view their orders using the Order List server control if its GuestOrderView
property is set to true
. See Also: OrderList Server Control
The Checkout server control has several sections, each representing a portion of the checkout process.
Prompts customers to enter or update billing information, including:
NOTE: If a customer chooses a country other than the United States, no field validation is applied to the postal code by default. To apply country-specific postal code validation, see this Ektron, Inc. Knowledge Base article:http://dev.ektron.com/kb_article.aspx?id=26072.
Add or edit shipping information. By default, it uses the billing address as the shipping address. From this screen, customers can:
When a logged-in customer adds a new address, it is stored with the account information in Ektron.
Select the type of shipping for products. Shipping methods that appear are defined in the Workarea > Settings > Commerce > Shipping > Methods. See Also: Shipping Methods.
Displays information about products being purchased: their price, shipping charges, discounts, and taxes. At this point, if customers want to modify their cart, they click Edit your cart. For example, a customer wants to apply a coupon to the cart. For this link to work properly, add the path to the template that contains the Cart server control to the Checkout server control’s TemplateCart
property.
On the Submit Order page, a customer enters payment information. The customer can pay by check, credit card, or PayPal, depending on what has been set up in the eCommerce Payment Options screen. When a customer enters the information, the customer clicks Submit. At that point, the charge is submitted to the payment gateway, and the order is posted in Ektron. See Also: Orders
The Order Complete page displays a Thank You note, the order ID, and links to continue shopping or view an order’s history.
The Continue Shopping link appears when you add the path of a template that allows a customer to find products to the TemplateShopping
property. For example, you send them to a template containing a ProductSearch
or ProductList
server control.
The Order History link appears when you add the path of a template containing the OrderList
server control to the TemplateOrderHistory
property.
The following chart represents the options and processes of the Checkout Server Control.
The following are Ektron-specific server control properties. You can find information about native .NET properties such as font, height, width and border style in Visual Studio® help.
Indicates if you are logged into the CMS Explorer and can use it to browse to content, collections, and so on. See Also: Browsing Your Ektron Site Using CMS Explorer.
The number of seconds that the server control’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See Also: Caching with Server Controls.
Reports or selects the current page (or phase) of the checkout control. This lets you customize the flow of the control. For example, if you only have one shipping option, you would skip the ShippingInfoEntry phase.
For an example of working with the CurrentPhase property in code-behind, download Ektron’s Developer Sample Site and view these files.Siteroot/Developer/Commerce/CheckoutDemo_Advanced.aspx
Siteroot/Developer/Commerce/CheckoutDemo_Advanced.aspx.cs
Phases are listed in the order which they happen within the control.
Lets you inject custom XML into the generated XML before being processed by the XSLT. Enter a string of XML that you want to make available to the XSLT as follows:
<root><customXml>custom-xml-inserted-here</customXml></root>
See Also: Displaying Custom XML in Ektron’s Server Controls.
The ID of the default country that appears in the Billing Address and Shipping Address. Set this to the country from which the majority of your customers make purchases. If a customer is from a different country, the customer can change it when editing the Billing or Shipping Address.
To find a country’s numeric ID, sign into the Ektron Workarea. Then go to Settings > Commerce > Configuration > Countries. The Numeric ID is in the left column of that screen.
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
The name of the parameter on the QueryString that identifies desired phase ID.
If desired, enter a relative or absolute path to an Xslt that determines the display of the page. By default, the control uses Checkout.xsl
. This file is located in siteroot\Workarea\Xslt\Commerce\Checkout\Standard
IMPORTANT: If you specify an external file, do not store this file in the Workarea folder. If you store this file in the Workarea folder, the file will be lost when you upgrade.
The message that is shown to a customer when an unhandled error occurs. Details are sent to the event log. The default message is “We're sorry, an error occurred while processing your request. Please try again later...”
Set to true if you wish to allow the Guest Checkout feature. See Also: Guest Account Registration
Hides or displays the output of the control in design time and run time.
When set to True, switches to an SSL encrypted URL. For the SSL encryption to work, you must have an SSL certificate installed for your site. See Also: Configuring SSL. Information on SSL can be found at the following Web sites.
Installing and using an SSL is one of the most important things you can do to protect your customer’s credit card data.
NOTE: Ektron, Inc. is not associated with TechFAQ or VeriSign. However, both sites offer good explanations of Secure Sockets Layer.
Set a language for viewing the checkout control. This property shows results in design-time (in Visual Studio) and at run-time (in a browser).
The image to display while the control is fetching data. The default is siteroot\Workarea\images
.
\application\ajax-loader_circle_lg.gif
Specify the path to a style sheet for use with this server control. The location can be relative or absolute. Leave blank to use the default style sheet.
Suppresses the output of the span/div tags around the control.
The URL path of the template that contains the Cart server control. The path can be relative or absolute.
When a path is entered, a link appears in the Review Order part of the process that allows a user to navigate to the template containing the Cart server control. See Also: Review Order and Cart Server Control
The URL path of the template that contains the OrderList server control. The path can be relative or absolute. When a path is entered, a link appears at the end of checkout process that allows a user to navigate to the template containing the OrderList server control. See Also: Order Complete and OrderList Server Control.
The URL path of the template that helps a customer recover a password. The path can be relative or absolute. When a path is entered and a customer has not logged in, a link appears at the beginning of checkout process that allows him to navigate to a template containing information to recover his password. The Membership server control contains an option for recovering passwords. See Also: Logging In or Setting Up an Account and Membership Server Control
The URL path of the template that allows the customer to continue shopping. If a path is entered, a link appears at the end of checkout that allows a user to navigate to a template that lets him continue shopping; for example, the template containing a ProductList or ProductSearch server control. See Also: Order Complete, ProductList Server Control and Product Search Server Controls
This example demonstrates how to add a custom field to the Checkout control's Billing Info entry screen.
In the workarea/XSLT/Commerce/Checkout/ folder, look for the Checkout_BillingInfo.xsl file. In the file, locate EktronCheckout_BillingInfo_Company_
. Under the bulleted list item for company, add the following:
<li class="EktronCheckout_Required EktronCheckout_SerializableContainer"> <label class="EktronCheckout_Row_LeftContents"> <xsl:attribute name="for"> EktronCheckout_BillingInfo_CustomField_<xsl:value-of select="$ControlId"/> </xsl:attribute> <span class="EktronCheckout_RequiredSymbol">*</span> A custom field </label> <input class="EktronCheckout_Company EktronCheckout_Row_RightContents" > <xsl:attribute name="name"> EktronCheckout_BillingInfo_CustomField_<xsl:value-of select="$ControlId"/> </xsl:attribute> <xsl:attribute name="id"> EktronCheckout_BillingInfo_CustomField_<xsl:value-of select="$ControlId"/> </xsl:attribute> <xsl:attribute name="value">ABCXYZ</xsl:attribute> </input> </<li>
Important notes:
EktronCheckout_NotRequired
is also acceptable.EktronCheckout_BillingInfo
is replaced with param__
internally. The last portion, CustomField
, is how the field will be referenced (see below).
In the codebehind of the page with the Checkout control, you need the following imports:
using Ektron.Cms.Controls; using Ektron.Cms.Controls.ECommerce; using Ektron.Cms.Controls.ECommerce.Checkout;
Next, place the following into the Page_Init method:
cmsCheckout.FilterAjaxCallback += this.HandleFilterAjaxCallback;
Then implement the HandleFilterAjaxCallback method:
protected void HandleFilterAjaxCallback(object sender, FilterAjaxCallbackEventArgs e) { string callbackParameters = e.EventArgs; System.Collections.Specialized.NameValueCollection data = Ektron.Cms.Common.EkFunctions.ConvertToNameValueCollection(callbackParameters, true); string customFieldValue = data["param__customfield"]; }
Upon completing the Billing Info screen, the data is returned as part of the EventArgs, with the prefix param__
(note the double underscore).
It can then be obtained directly by converting the string to a NameValueCollection
(or other construct). Developers are free to call their own methods from here.