Upgrading an existing store for WebSphere Commerce version 7, feature pack 5

An existing store based on the Madisons store requires some additional configuration and store programming tasks to ensure that it supports the side-by-side integration feature for WebSphere® Commerce Version 7, Feature Pack 5 or WebSphere Commerce Version 7, Feature Pack 6.

Before you begin

  • Upgrade WebSphere Commerce Version 7, Feature Pack 3 to WebSphere Commerce Version 7, Feature Pack 5.
  • Enable the store enhancements feature.
  • Integrate WebSphere Commerce with Distributed Order Management with Sterling Order Management, Release 9.2 or later.

Procedure

First, make FlexFlow usable in CMC, which enables the side-by-side integration feature in the store front.

  1. Locate and backup the following file:
    WC_eardir\LOBTools.war\config\commerce\store\propertiesViews\storedir\StoreFlexFlowPropertiesView.def
  2. Locate <PropertyPane definitionName="stoOrdersFlexFlow_storeId">
  3. Add the following as the last sub element of <PropertyGroup name="group" collapsable="false">
    <PropertyCheckbox 
    name="SideBySideIntegration.checkbox" 
    helpText="${stoFlexFlow_storeId.SideBySideIntegration.checkboxEnable.title}" 
    promptText="${stoFlexFlow_storeId.SideBySideIntegration.checkboxEnable.label}" 
    objectPath="StoreFlow[name=SideBySideIntegration]" propertyName="enabled"/>
  4. Login to the WebSphere Commerce server Administrative Console and deploy the file to the WebSphere Commerce application.
  5. Locate and backup the following files:
    WC_eardir\properties\tools\stores\storedir\devtools\flow\ui\config_locale.properties and
    WC_eardir\properties\tools\stores\storedir\devtools\flow\ui\config.properties
  6. Locate the following comment:
    ###########################################################################
    #
    #Orders panel
    #
    ###########################################################################
    and add these lines at the end of the section, updating the title and label according to your specifications:
    SideBySideIntegration.checkboxEnable.title =Enable Integrating with Sterling Order Management
    SideBySideIntegration.checkboxEnable.label =Integrating with Sterling Order Management
  7. Login to the WebSphere Commerce server Administrative Console and deploy the file to the WebSphere Commerce application.
  8. Back up the database.

  9. Update the EMSPORT and DMEMSPOTDEF tables by executing the following two SQL statements (ensure that EMSPOT_ID and DMEMSPOTDEF_ID do not already exist):
    INSERT INTO EMSPOT 
       (EMSPOT_ID,STOREENT_ID,NAME,USAGETYPE)
    VALUES 
       (-1000,storeId,'SideBySideIntegration','STOREFEATURE' );
    INSERT INTO  DMEMSPOTDEF 
       (DMEMSPOTDEF_ID,EMSPOT_ID,STOREENT_ID,CONTENTTYPE,CONTENT,OPTCOUNTER) 
    VALUES 
       (-1000,-1000,storeId,'FeatureEnabled','true',1);
  10. Restart the WebSphere Commerce server.
    This is an example of using the SideBySideIntegration flex flow:
    <flow:ifEnabled feature="SideBySideIntegration">			         
         ......
      </flow:ifEnabled>
      <flow:ifDisabled feature="SideBySideIntegration">
         ......
      </flow:ifDisabled>

On the My Account page, the order history for the Shopper needs to be displayed. In the integration scenario, orders are kept in Sterling Order Management, and some temporarily unsuccessfully transferred orders are kept in WebSphere Commerce. Services and customization that are used to get history orders for the shopper include the getOrder service.

  1. Use the getOrder service to merge orders from WebSphere Commerce local and Sterling Order Management:
    <flow:ifEnabled feature="SideBySideIntegration">
    			 	<wcf:getData type="com.ibm.commerce.order.facade.datatypes.OrderType[]" 
                var="allOrdersInThisCategory" varShowVerb="ShowVerbAllOrdersInThisCategory" 
                expressionBuilder="findByOrderStatusExt" 
    maxItems="${max}" recordSetStartNumber="${start}" recordSetReferenceId="orderstatus">
     	      <wcf:param name="status" value="N,M,A,B,C,R,S,D,F,H" />
            		<wcf:param name="extOrderId" value="${extOrderId}"  />
         	 		<wcf:param name="recordSetTotal" value="${recordSetTotal}"  />
           		<wcf:param name="accessProfile" value="IBM_Summary" />
          	</wcf:getData>
    </flow:ifEnabled>
    where
    max
    is the pageSize for order history list page, i.e., the number of orders will be displayed in one page.
    start
    is the beginIndex of current page, starting from 0. For example, if the current page is the second page and pageSize is 20, then the beginIndex is 20.
    extOrderId
    is the OrderHeaderKey for the last order in previous page. For example, if the OrderHeaderKeys for orders on the second page are "OrderHeaderKey20", "OrderHeaderKey21" ... "OrderHeaderKey39," then when loading the third page, "OrderHeaderKey39" needs to be passed as the value for parameter extOrderId. extOrderId is empty if this is the first page, or the last order on the previous page is a WebSphere Commerce local order that does not have a OrderHeaderKey.
    recordSetTotal
    is the total number of orders for current shopper. This can be determined from the last call of this service, which is ShowVerbAllOrdersInThisCategory.recordSetTotal. When loading the first page, the value is 0.
    Note:

    To support Order List pagination, the parameters that are passed during pagination should satisfy the criteria that the input parameters needed in 12 can be resolved by using them.

To update the display or Order Number and Order Status, do the following:

  1. For Order Number, display order.orderIdentifier.uniqueID, not order.orderIdentifier.externalOrderID (the OrderHeaderKey for Sterling Order Management orders).
  2. For Order Status, in the order history list page, if the order status is H, display it as M.
  3. In the WC_eardir\Stores.war\Madisons\storetext_locale.properties and WC_eardir\Stores.war\Madisons\storetext.properties files, add and update the new statuses K and V and the refined statuses for G, M, S, D, F, and X.

    Status descriptions are located at WC_installdir\instances\instance_name\starterstores\ConsumerDirect\Aurora.sar\StoreAssetsDir\storetext_v2_locale.properties. Example: MO_OrderStatus_M designates "Order received and ready for processing."

The SSFSOrderCopy command is used to reorder a Sterling Order Management order in the Order List page. For orders that are kept in Sterling Order Management, AjaxSSFSOrderCopy is provided as the struts action to reorder an existing Sterling Order Management order.

  1. Customize SSFSOrderCopy as required.

    Here is an example that defines a URL for AjaxSSFSOrderCopy:

    <wcf:url value="AjaxSSFSOrderCopy" var="SSFSOrderCopyUrl" type="Ajax">
        <wcf:param name="OrderHeaderKey" value="${objectId}"/>
        <wcf:param name="OrderNo" value="${order.orderIdentifier.uniqueID}"/>
        <wcf:param name="toOrderId" value=".**."/>
        <wcf:param name="calculate" value="1"/>
        <wcf:param name="storeId" value="${WCParam.storeId}"/>
        <wcf:param name="catalogId" value="${WCParam.catalogId}"/>
        <wcf:param name="langId" value="${WCParam.langId}"/>
     </wcf:url>
    where
    calculate
    indicates whether OrderCalculate will be called after OrderCopy.
    Values:
    0: OrderCalculate is NOT called after OrderCopy;
    1: OrderCalculate is called after OrderCopy
    OrderNo
    is the unique order ID of an order.
    OrderHeaderKey
    is the external order ID of an order, such as the OrderHeaderKey for a Sterling Order Management order.
    toOrderId
    is the target order that this order is copying to. Sample value: .**. indicates current pending order.
  2. Ensure to go to AjaxCheckoutDisplayView after reorder.

    See the SSFSOrderCopy service declaration in WC_installdir\instances\instance_name\starterstores\ConsumerDirect\Aurora.sar\StoreAssetsDir\javascript\UserArea\MyAccountServicesDeclaration.js .

  3. Disable the ReOrder function if the order is canceled.
    For Sterling Order Management orders, orders with status X are listed. If the order status is X, do not display or disable the Reorder button. Otherwise exceptions will occur, because the item quantity for a canceled order is 0. Refer to the following files for details:
    • For order list, see WC_installdir\instances\instance_name\starterstores\ConsumerDirect\Aurora.sar\StoreAssetsDir\Snippets\Order\Cart\OrderStatusTableDetailsDisplay.jsp
    • For order list pagination, see WC_installdir\instances\instance_name\starterstores\ConsumerDirect\Aurora.sar\StoreAssetsDir\javascript\UserArea\MyAccountDisplay.js

Get order details: In the side-by-side integration scenario, orders are displayed in order list page. Orders that are kept in Sterling Order Management need to call the Sterling Order Management getCompleteOrderDetails API to get details of the order.

The tag getDataFromSSFS can be used to call getCompleteOrderDetails API. This tag returns a JSON. Then JavaScript can be used to resolve the JSON, and display the order attributes.

  1. Use the getDataFromSSFS tag for getCompleteOrderDetails.
    <wcfSSFS:getDataFromSSFS type="java.lang.String" var="order" scApi="getCompleteOrderDetails"
    scope="request"> <wcf:param name="OrderHeaderKey" value="${WCParam.externalOrderId}"/> <wcf:param name="EnterpriseCode" value="${WCParam.storeId}"/> <wcf:param name="BuyerUserId" value="${userId}"/> <wcf:param name="langId" value="${langId}"/> </wcfSSFS:getDataFromSSFS>
    The getDataFromSSFS tag calls the getCompleteOrderDetails API with the following input parameters:
    OrderHeaderKey
    is the external order ID of this order, for example, the OrderHeaderKey for a Sterling Order Management order.
    EnterpriseCode
    is the current store ID.
    BuyerUserId
    is the current user ID.

    The getCompleteOrderDetails API returns a JSON string with the variable name "order."

  2. Get attributes of the order and order item from the string returned by getDataFromSSFS tag.
    This is an example of the JSON returned:
    {"Root":{"Order":
    {"OrderHeaderKey":"2012042802234914026","CarrierServiceCode":"","EnterpriseCode":"10001",
    "OrderNo":"WC_28001","ScacAndService":"","HeaderCharges":true,"DocumentType":"0001",
    "Awards":true,"AuthorizedClient":"WCS","EntryType":"WCS","HeaderTaxes":true,
    "shipmentTypeId":1,"OrderLines":{"OrderLine":[{"OrderLineKey":"2012042802234914028"......}]},
    "countOfPaymentMethods":1,"SCAC":"","countOfOrderLines":2,"Shipments":true,"OrderDate":
    "2012-04-28T06:23:08Z"......}}}
    This is an example of getting the order number from the JSON using JavaScript:
    var jsonOrder = eval("("+order+")");//order is the JSON var returned by getDataFromSSFS tag.
    if(!this.isNullObj(jsonOrder.Root.Order.OrderNo)){
              var orderNo = jsonOrder.Root.Order.OrderNo;
            	 if(!this.isNullObj(jsonOrder.Root.Order.EntryType)){
    		                  var entryType = jsonOrder.Root.Order.EntryType;
    	                  	if(entryType == 'WCS'){
    		                         	orderNo = orderNo.substring(3);// remove prefix 'WC_'
    		                  }
              }
    }