![]() |
![]() |
|
|
Order Summary and Confirmation Services
Prior to submitting their order, your customers will want to review an order summary that includes information about the items they have decided to purchase, as well as other information (shipping, payment, and tax) related to their order. Following order submission, it is customary to provide your customers with a confirmation page, which customers can save and later use to check on the status of their order. The Order Summary and Confirmation Services allow you to do just that, and this topic describes how.
This topic includes the following sections:
JavaServer Pages (JSPs)
This section describes the JavaServer Pages (JSPs) used to implement the Order Summary and Confirmation Services. You can use them on your own e-commerce site, or customize them to meet your requirements.
Note: For a description of the complete set of JSPs used in the WebLogic Commerce Server Web application and a listing of their locations in the directory structure, see the E-Commerce JSP Template Summary.
checkout.jsp Template
The checkout.jsp template (shown in Figure 7-1) provides a customer with a final look at all the details of their order, before the customer commits or cancels the order. Information displayed includes the shipping address, shipping details, a list of the items ordered (including the item name, short description, quantity, price, and subtotal), shipping and handling costs, tax costs, and total cost.
Customers must click the Complete Purchase button to commit their order. Customers wishing to return to the previous page can click the Back button instead.
Sample Browser View
Figure 7-1 shows an annotated version of the checkout.jsp template. A description of the annotated regions follow the figure.
Figure 7-1 Annotated checkout.jsp Template
The numbers in the following list refer to the numbered regions in the figure:
Location in the WebLogic Commerce Server Directory Structure
You can find the checkout.jsp template file at the following location, where WL_COMMERCE_HOME is the directory in which you installed WebLogic Commerce Server:
%WL_COMMERCE_HOME%\config\wlcsDomain\applications\wlcs\commerce\order\
checkout.jsp (Windows)
$WL_COMMERCE_HOME/config/wlcsDomain/applications/wlcs/commerce/order/
checkout.jsp (UNIX)
Tag Library Imports
The checkout.jsp template uses existing WebLogic Server JSP tags, and the WebLogic Personalization Server's User Management and Personalization JSP tags. It also uses Pipeline JSP tags. Therefore, the template includes the following JSP tag libraries:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
<%@ taglib uri="pipeline.tld" prefix="pipeline" %>
<%@ taglib uri="um.tld" prefix="um" %>
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="i18n.tld" prefix="i18n" %>
Note: For more information on the WebLogic Server JSP tags or the WebLogic Personalization Server JSP tags, see "JSP Tag Reference" in the Guide to Building Personalized Applications. For more information about the Pipeline JSP tags, see the Guide to Managing Presentation and Business Logic: Using Webflow and Pipeline.
These files reside in the following directory for the WebLogic Commerce Server Web application:
%WL_COMMERCE_HOME%\config\wlcsDomain\applications\\wlcs\WEB-INF (Windows)
$WL_COMMERCE_HOME/config/wlcsDomain/applications/wlcs/WEB-INF (UNIX)
Java Package Imports
The checkout.jsp template uses Java classes in the following packages and therefore includes these import statements:
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.beasys.commerce.webflow.*" %>
<%@ page import="com.beasys.commerce.axiom.units.*" %>
<%@ page import="com.beasys.commerce.axiom.contact.*" %>
<%@ page import="com.beasys.commerce.ebusiness.shoppingcart.*" %>
<%@ page import="com.beasys.commerce.foundation.pipeline.*" %>
<%@ page import="com.bea.commerce.ebusiness.price.service.DiscountPresentation" %>
<%@ page import="com.bea.commerce.ebusiness.price.quote.OrderAdjustment" %>
<%@ page import="com.bea.commerce.ebusiness.price.quote.AdjustmentDetail" %>
<%@ page import="com.bea.commerce.ebusiness.price.quote.AdjustmentType" %>
Location in Default Webflow
Customers arrive at the checkout.jsp template from the payment information page (payment.jsp). If customers choose to commit their order, they will continue to the order confirmation page (confirmorder.jsp). If customers choose to cancel, they will be sent back to the payment page (payment.jsp).
Note: For more information about the default Webflow, see Overview of Managing Purchases and Processing Orders.
Events
The checkout.jsp template presents a customer with two buttons, each of which is considered an event. These events trigger a particular response in the default Webflow that allows customers to continue. While this response can be to load another JSP, it is usually the case that an input processor or Pipeline is invoked first. Table 7-1 provides information about these events and the business logic they invoke.
Event |
Webflow Response(s) |
---|---|
button(back) |
No business logic required. Loads payment.jsp. |
button(purchase) |
CommitOrder |
Table 7-2 briefly describes each of the Pipelines from Table 7-1, as they are defined in the pipeline.properties file. For more information about individual Pipeline components, see Pipeline Components.
Dynamic Data Display
The purpose of the checkout.jsp template is to display the data specific to a customer's shopping experience for their final review. This is accomplished on the checkout.jsp template using a combination of Pipeline and WebLogic Personalization Server JSP tags and accessor methods/attributes.
First, the getProfile JSP tag is used to set the customer profile (context) for which the customer information should be retrieved, as shown in Listing 7-1.
Listing 7-1 Setting the Customer Context
<um:getProfile
profileKey="<%=request.getRemoteUser()%>
profileType="WLCS_Customer" />
Note: For more information on the WebLogic Personalization Server JSP tags, see "JSP Tag Reference
" in the Guide to Building Personalized Applications.Next, the getPipelineProperty JSP tag retrieves the SHIPPING_ADDRESS and SHOPPING_CART attributes from the Pipeline session. Table 7-3 provides more detailed information on these attributes.
Listing 7-2 illustrates how some of these attributes are retrieved from the Pipeline session.
Listing 7-2 Retrieving Check Out Attributes
<pipeline:getPipelineProperty
propertyName="<%=PipelineSessionConstants.SHOPPING_CART%>"
returnName="shoppingCart"
returnType="com.beasys.commerce.ebusiness.shoppingcart.ShoppingCart"/>
<pipeline:getPipelineProperty
propertyName="<%=PipelineSessionConstants.SHIPPING_ADDRESS%>"
returnName="shippingAddress"
returnType="com.beasys.commerce.axiom.contact.Address"/>
Note: For more information on the getPipelineProperty JSP tag, see the Guide to Managing Presentation and Business Logic: Using Webflow and Pipeline.
For the data stored in the customer profile and retrieved using the getProfile JSP tag, use the getPropertyAsString JSP tag to display the customer information, as shown in Listing 7-3.
Listing 7-3 Displaying Data Stored in the Customer's Profile
<table>
<tr>
<td>
<um:getPropertyAsString propertyName="firstName" />
<um:getPropertyAsString propertyName="lastName" />
</td>
</tr>
</table>
Note: For more information on the WebLogic Personalization Server JSP tags, see "JSP Tag Reference" in the Guide to Building Personalized Applications.
The data stored within the Pipeline session attributes (retrieved using the getPipelineProperty JSP tag) is displayed by using accessor methods/attributes within Java scriptlets. Table 7-4 provides more detailed information on these methods/attributes for Address, ShoppingCart, and ShoppingCartLine.
Because the getShoppingCartLineCollection() method allows you to retrieve a collection of the individual lines within a shopping cart, there are also accessor methods/attributes you can use to break apart the information contained within each line. Table 7-6 provides information about these methods/attributes.
Listing 7-4 illustrates how these accessor methods/attributes are used within Java scriptlets.
Listing 7-4 Using Accessor Methods/Attributes Within checkout.jsp Java Scriptlets
<wl:repeat set="<%=shoppingCart.getShoppingCartLineCollection().iterator()%>"
id="shoppingCartLine" type="ShoppingCartLine" count="100000">
<tr>
<td nowrap valign="top">
<div class="tabletext">
<%=shoppingCartLine.getProductItem().getKey().getIdentifier()%>
</div>
</td>
<td valign="top">
<div class="tabletext">
<%=shoppingCartLine.getProductItem().getName()%>
</div>
</td>
<td align="center" valign="top">
<div class="tabletext">
<%=WebflowJSPHelper.quantityFormat(shoppingCartLine.getQuantity() %>
</div>
</td>
<td align="right" nowrap valign="top">
<div class="tabletext">
<%=shoppingCartLine.getUnitPrice().getCurrency()%>
<%=WebflowJSPHelper.priceFormat(shoppingCartLine.getUnitPrice().
getValue())%>
</div>
</td>
</tr><tr>
<td colspan="5"><hr size="1"></td>
</tr>
</wl:repeat>
<tr>
<td colspan="4" align="right">
<div class="tabletext">Shipping & handling</div>
</td>
<td align="right" nowrap>
<% Money shipping=shoppingCart.getTotal(ShoppingCartConstants.LINE_SHIPPING);
%>
<div class="tabletext">
<%=shipping.getCurrency()%>
<%=WebflowJSPHelper.priceFormat(shipping.getValue())%>
</div>
</td>
</tr><tr>
<td colspan="4" align="right">
<div class="tabletext">Total tax</div>
</td>
<td align="right" nowrap>
<% Money tax=shoppingCart.getTotal(ShoppingCartConstants.LINE_TAX); %>
<div class="tabletext">
<%=tax.getCurrency()%>
<%=WebflowJSPHelper.priceFormat(tax.getValue())%>
</div>
</td>
</tr><tr>
<td colspan="4" align="right">
<div class="tabletext"><b>Total due</b></div>
</td>
Form Field Specification
The checkout.jsp template does not make use of any form fields.
confirmorder.jsp Template
The confirmorder.jsp template (shown in Figure 7-2) displays the information about the customer's order after they have committed it. This information is the same as that shown in the checkout.jsp template, but also includes an order confirmation number customers can use to access information about the order in the future. The confirmorder.jsp template also provides the customer with a Continue Shopping button that will bring the customer back to the product catalog.
Sample Browser View
Figure 7-2 shows an annotated version of the confirmorder.jsp template. A description of the annotated regions follow the figure.
Figure 7-2 Annotated confirmorder.jsp Template
The numbers in the following list refer to the numbered regions in the figure:
Location in the WebLogic Commerce Server Directory Structure
You can find the confirmorder.jsp template file at the following location, where WL_COMMERCE_HOME is the directory in which you installed WebLogic Commerce Server:
%WL_COMMERCE_HOME%\server\webapps\wlcs\commerce\order\
confirmorder.jsp (Windows)
$WL_COMMERCE_HOME/server/webapps/wlcs/commerce/order/
confirmorder.jsp (UNIX)
Tag Library Imports
The confirmorder.jsp template uses existing WebLogic Server and the WebLogic Personalization Server's User Management and Personalization JSP tags. It also uses Pipeline JSP tags. Therefore, the template includes the following JSP tag libraries:
<%@ taglib uri="weblogic.tld" prefix="wl" %>
<%@ taglib uri="pipeline.tld" prefix="pipeline" %>
<%@ taglib uri="um.tld" prefix="um" %>
<%@ taglib uri="es.tld" prefix="es" %>
<%@ taglib uri="i18n.tld" prefix="i18n" %>
Note: For more information on the WebLogic Server JSP tags or the WebLogic Personalization Server JSP tags, see "JSP Tag Reference" in the Guide to Building Personalized Applications. For more information about the Pipeline JSP tags, see the Guide to Managing Presentation and Business Logic: Using Webflow and Pipeline.
These files reside in the following directory for the WebLogic Commerce Server Web application:
%WL_COMMERCE_HOME%\config\wlcsDomain\applications\\wlcs\WEB-INF (Windows)
$WL_COMMERCE_HOME/config/wlcsDomain/applications/wlcs/WEB-INF (UNIX)
Java Package Imports
The confirmorder.jsp template uses Java classes in the following packages and therefore includes these import statements:
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="com.beasys.commerce.webflow.PipelineSessionConstants" %>
<%@ page import="com.beasys.commerce.axiom.units.*" %>
<%@ page import="com.beasys.commerce.axiom.contact.*" %>
<%@ page import="com.beasys.commerce.ebusiness.order.*" %>
<%@ page import="com.beasys.commerce.ebusiness.shipping.*" %>
<%@ page import="com.beasys.commerce.foundation.pipeline.*" %>
<%@ page import="com.beasys.commerce.webflow.*" %>
<%@ page import="com.beasys.commerce.ebusiness.catalog.*" %>
Location in Default Webflow
Customers arrive at confirmorder.jsp template from the final checkout page (checkout.jsp). The default Webflow does not define a subsequent JSP template.
Note: For more information about the default Webflow, see Overview of Managing Purchases and Processing Orders.
Events
There are no events associated with the confirmorder.jsp template.
Dynamic Data Display
The purpose of the confirmorder.jsp template is to display the data specific to a customer's shopping experience along with a unique order confirmation number. This is accomplished on the confirmorder.jsp template using a combination of Pipeline and WebLogic Personalization Server JSP tags and accessor methods/attributes.
First, the getProfile JSP tag is used to set the customer profile (context) for which the customer information should be retrieved, as shown in Listing 7-5.
Listing 7-5 Setting the Customer Context
<um:getProfile
profileKey="<%=request.getRemoteUser()%>
profileType="WLCS_Customer" />
Note: For more information on the WebLogic Personalization Server JSP tags, see "JSP Tag Reference" in the Guide to Building Personalized Applications.
Next, the getPipelineProperty JSP tag retrieves the ORDER_VALUE and SHIPPING_METHOD attributes from the Pipeline session. Table 7-7 provides more detailed information about these attributes.
Listing 7-6 illustrates how these attributes are retrieved from the Pipeline session.
Listing 7-6 Retrieving Order Confirmation Attributes
<pipeline:getPipelineProperty
propertyName="<%=PipelineSessionConstants.ORDER_VALUE%>"
returnName="orderValue"
returnType="OrderValue"
attributeScope="<%=PipelineConstants.REQUEST_SCOPE%>" />
<pipeline:getPipelineProperty
propertyName="<%=PipelineSessionConstants.SHIPPING_METHOD%>"
returnName="shippingMethodValue"
returnType="com.beasys.commerce.ebusiness.shipping.ShippingMethodValue"/>
Note: For more information on the getPipelineProperty JSP tag, see the Guide to Managing Presentation and Business Logic: Using Webflow and Pipeline.
For the data stored in the customer profile and retrieved using the getProfile JSP tag, use the getPropertyAsString JSP tag to display the customer information, as shown in Listing 7-7.
Listing 7-7 Displaying Data Stored in the Customer's Profile
<table>
<tr>
<td>
<um:getPropertyAsString propertyName="firstName" />
<um:getPropertyAsString propertyName="lastName" />
</td>
</tr>
</table>
Note: For more information on the WebLogic Personalization Server JSP tags, see "JSP Tag Reference" in the Guide to Building Personalized Applications.
The data stored within the Pipeline session attributes (retrieved using the getPipelineProperty JSP tag) is displayed by using accessor methods/attributes within Java scriptlets. Table 7-8 through Table 7-11 provide more detailed information on these methods/attributes for Address, ShippingMethodValue, OrderValue, and Orderline.
Method/Attribute |
Description |
---|---|
description |
A description of the shipping method. |
identifier |
Key in the database for the shipping method. |
Because the orderLines attribute allows you to retrieve the individual lines within an order, it also has accessor methods/attributes you can use to display the information contained within each line. These methods/attributes are listed in Table 7-11.
Listing 7-8 illustrates how these accessor methods/attributes are used within Java scriptlets.
Listing 7-8 Using Accessor Methods Within confirmorder.jsp Java Scriptlets
<!--Iterate through order to get all order lines -->
<wl:repeat set="<%=orderValue.orderLines.iterator()%>" id="orderLine"
type="OrderLine" count="100000">
<tr>
<td valign="top" align="left">
<div class="tabletext">
<%=orderLine.getProductIdentifier()%>
</div>
</td>
<td valign="top" align="left">
<div class="tabletext">
<%=orderLine.getDescription()%>
</div>
</td>
<td align="center" valign="top">
<div class="tabletext">
<%=WebflowJSPHelper.quantityFormat(orderLine.getQuantity())%>
</div>
</td>
<td align="right" valign="top" nowrap>
<div class="tabletext">
<%=orderLine.getUnitPrice().getCurrency()%>
<%= WebflowJSPHelper.priceFormat(orderLine.getUnitPrice().getValue())%>
</div>
</td>
</tr>
For a code example of the ShoppingCart and ShoppingCartLine accessor methods/attributes, see Shopping Cart Management Services.
Form Field Specification
The confirmorder.jsp template does not make use of any form fields.
Input Processors
No input processors are used in the Order Summary and Confirmation Services JSP template(s).
Pipeline Components
This section provides a brief description of each Pipeline component associated with the Order Summary and Confirmation Services JSP template(s).
Note: Some Pipeline components extend other, base Pipeline components. For more information on the base classes, see the Javadoc.
CommitOrderPC
ResetCheckoutPC
PurchaseTrackerPC
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|