Order tag
The HCL Commerce order tag collects information about a customer's order. The order tag creates two data sets: one for the shopping cart contents at the time of the order and the other for the order summary information.
- Product part number
- Product name
- Quantity
- Base price
- Customer identifier
- Order identifier
- Subtotal
- Product category in the catalog the customer is currently browsing
- Product category in the master catalog
- Currency
- Account name (when the transaction is a B2B transaction)
- Contract name (when the transaction is a B2B transaction)
- Store identifier
- Order identifier
- Order subtotal
- Shipping charges that are associated with the order
- Customer identifier
- Customer city
- Customer state
- Customer ZIP code
- Currency
- Promotion names that are applied to the order, which is separated by the delimiter '|'
- Promotion adjustment values, which are separated by the delimiter '|'
- Promotion codes, which are separated by the delimiter '|'
- Store identifier
Parameters
The following is a list of required and optional parameters for the order tag.
Note for IBM Digital Analytics: The following
parameters are for the HCL Commerce
<cm:order />
tag. This tag generates the IBM Digital Analytics
cmCreateShopAction9Tag
data tag and cmCreateOrderTag
data
tag.
- databean
- Use this parameter if your order confirmation page JSP file already contains an order data bean.
This parameter is a populated instance of the com.ibm.commerce.order.beans.OrderDataBean.
Using the
databean
parameter provides better performance than theorderId
parameter because the order tag does not have to use other resources to generate the data bean from theorderId
. - orderType
- Use this parameter if your order confirmation page uses web services for order runtime
functions. This parameter is a populated instance of the
com.ibm.commerce.order.facade.datatypes.OrderType
object.Using the
orderType
parameter provides better performance than theorderId
parameter because the order tag does not have to use other resources to generate theorderType
data from theorderId
. - orderId
- If neither of the previous two parameters applies, use the
orderId
parameter. This parameter is the order ID of the order that is being displayed. The order tag automatically creates an order data bean to get the information that the external analytics system requires. This parameter is ignored if you have used thedatabean
parameter or theorderType
parameter. - useKitItems
- This is an optional parameter. Set this parameter to true to process items in kits as separate order items.
To send tax-related data to the external analytics system, use the following additional parameters:
- includeTaxInUnitPrice
- An optional parameter that is used to conditionally exclude or include the tax along with the
unit price sent to the external analytics system. The default value is
false
. If set totrue
, the unit price sent to the external analytics system is the sum of the unit price and the tax that is calculated for the particular product. - includeTaxInTotalPrice
- An optional parameter that is used to conditionally exclude or include the tax along with the
total price sent to the external analytics system. The default value is
false
. If set totrue
, the total price sent to the external analytics system is the sum of the order total and the tax that is calculated for the order totals. For IBM Digital Analytics: if this value is set totrue
, the shipping charges passed to IBM Digital Analytics in thecmCreateOrderTag
data tag also include the shipping tax. If this value is set to false, the shipping charges passed to IBM Digital Analytics do not include the shipping tax.
You can use any of the following three parameters to send more information to the external analytics system:
- extraparms
- An optional parameter that you can use to send additional information that
applies to all catalog entries in the order to the external analytics system. This parameter is
provided for cases in which you might have negotiated `with the external analytics vendor to
generate some custom report that requires additional information.
Note for : Use the
extraparms
parameter to pass either Explore attributes, or data for custom reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter.There are multiple ways to pass values using theextraparms
parameter:Description Example Specify explicit values as properly escaped JavaScript. To pass more than one value, separate values with a comma. extraparms="\"value1\", \"value2\""
Specify explicit values without escaping the values. To pass more than one value, separate values with a comma. extraparms="value1, value2"
Specify dynamic content by calling a method name. Any parameter using extraparms
starting and ending with the $ symbol, for example,$getMethod$
, is assumed to be a method name of the object that is passed using either of the parametersdatabean
ororderType
. The only restriction on the method name is that it must take no arguments and the object that is returned must implement thetoString()
method.extraparms="$getMethod$"
- extraparmsMap
- An optional parameter that you can use to send additional information
that applies to specific catalog entries in the order to the external analytics system. This
parameter is an alternative to the
extraparms
parameter when you want to attach different extra parameter values to each order item in the shopping cart instead of attaching the same extra parameter value to every item in the shopping cart.Note for : Use the
extraparmsMap
parameter to pass either Explore attributes, or data for custom reports, or both. See Comparison of extra parameters for IBM Digital Analytics tags.The input to this parameter is a java.util.Map type object in which the key for each entry in the map is the
orderItemId
The value for a particular key is the extra parameter that is passed along with the catalog entry associated with the order item. The value for eachorderItemId
is appended to the argument list for the analytics tag output of that particular order item.The following is sample code to create a java.util.HashMap object to pass as the value for the
extraparmsMap
parameter:<wcf:getData type="com.ibm.commerce.order.facade.datatypes.OrderType" var="orderForAn" expressionBuilder="findByOrderId" scope="request"> <wcf:param name="accessProfile" value="IBM_Details" /> <wcf:param name="orderId" value="${WCParam.orderId}" /> </wcf:getData> <% java.util.HashMap map = new java.util.HashMap(); com.ibm.commerce.order.facade.datatypes.OrderType ord = (com.ibm.commerce.order.facade.datatypes.OrderType) pageContext.getAttribute ("orderForAn",PageContext.REQUEST_SCOPE); java.util.List orderItemList = ord.getOrderItem(); java.util.Iterator itr = orderItemList.iterator(); int i = 1; while (itr.hasNext()) { com.ibm.commerce.order.facade.datatypes.OrderItemType orderItemObj = (com.ibm.commerce.order.facade.datatypes.OrderItemType) itr.next(); String id = orderItemObj.getOrderItemIdentifier().getUniqueID(); map.put(id, "value" + i+ ".0-_-value" + i+ ".1"); i++; } pageContext.setAttribute("eMap",map); %>
- orderExtraparms
- An optional parameter that you can use to send additional information
that applies to the order summary to the external analytics system.
Note for : Use the
orderExtraparms
parameter to pass either Explore attributes, or data for custom reports, or both. See Passing extra data to IBM Digital Analytics with the extraparms parameter.There are multiple ways to pass values using theorderExtraparms
parameter:Description Example Specify explicit values as properly escaped JavaScript. To pass more than one value, separate values with a comma. orderExtraparms="\"value1\", \"value2\""
Specify explicit values without escaping the values. To pass more than one value, separate values with a comma. orderExtraparms="value1, value2"
Specify dynamic content by calling a method name. Any parameter using extraparms
starting and ending with the $ symbol, for example,$getMethod$
, is assumed to be a method name of the object that is passed using either of the parametersdatabean
ororderType
. The only restriction on the method name is that it must take no arguments and the object that is returned must implement thetoString()
method.orderExtraparms="$getMethod$"
Tag versions
HCL Commerce provides two versions of the order tag:
- An abstract base tag implementation class: com.ibm.commerce.bi.taglib.OrderBaseTag. Analytics vendors who want to provide an order tag in their web analytics JSP tag library can extend this base tag class to get the order tag data and implement their own logic to generate the vendor-specific order tagging APIs.
- A default implementation of the order tag (
<cm:order />
) for IBM Digital Analytics. This implementation automatically generates the IBM Digital AnalyticscmCreateShopAction9Tag
data tag andcmCreateOrderTag
data tag.