Feature Pack 8

Customizing the catalog entry details page to retrieve specific merchandising associations

You can customize the catalog entry details page for a catalog entry type to use merchandising association enhancements to the productViewHandler REST service and the categoryNavigationView noun. By customizing your catalog entry details pages to use the enhanced REST service, you can define the specific merchandising association types that return for each type of catalog entry. By default all merchandising associations that are associated with a catalog entry are displayed when a shopper views the catalog entry details for a catalog entry.

Procedure

  1. Go to the following directory, which contains the catalog entry details JSP files for each catalog entry type.
    • WC_installdir/Stores/WebContent/store_name/ShoppingArea/CatalogSection/CatalogEntrySubsection
    • WebSphere Commerce Developerworkspace_dir\Stores\WebContent\store_name\ShoppingArea\CatalogSection\CatalogEntrySubsection
    Where store_name is the name of your store directory, for example, Aurora.
  2. Open the catalog entry details JSP file for editing for the catalog entry type that you want to customize.
    • For products or SKUS, open the ProductDisplay.jsp file.
    • For bundles, open the BundleDisplay.jsp file.
    • For SKUs, open the ItemDisplay.jsp file.
    • For static kits, open the PackageDisplay.jsp file.
    • For dynamic kits, open the DynamicKitDisplay.jsp file.
    • For predefined dynamic kits, open the PDKDisplay.jsp file.
  3. Customize the catalog entry details JSP file to define the merchandising associations that are to return for that catalog entry type.
    1. In the JSP file, find the code that calls the default productViewHandler REST service. Search the file for the catalogNavigationView REST response.
      For example, in the BundleDisplay.jsp file, the following code defines the call to the REST service.
      <wcf:rest var="catalogNavigationView" url="${searchHostNamePath}${searchContextPath}/store/${WCParam.storeId}/productview/byId/${productId}" >	
      		<wcf:param name="langId" value="${langId}"/>
      		<wcf:param name="currency" value="${env_currencyCode}"/>
      		<wcf:param name="responseFormat" value="json"/>		
      		<wcf:param name="catalogId" value="${WCParam.catalogId}"/>
      	</wcf:rest>
    2. Add a parameter within the REST call definition to specify the specific merchandising association type that is to return for the catalog entry.
      Add the following code to include this merchandising association type parameter.
      <wcf:param name="associationType" value=""/>
    3. Specify a value for the associationType parameter. You can include a single merchandising association type or use a loop to include multiple types as the value.
      You can include the following values to identify a merchandising association type that is provided by default with WebSphere Commerce.
      ACCESSORY
      Indicates that accessories that complement the selected catalog entry are to return.
      UPSELL
      Indicates that an up-sell suggestion is to return to suggest a better catalog entry for the shopper to consider purchasing.
      X-SELL
      Indicates that a cross-sell suggestion is to return to suggest other catalog entries for the shopper to purchase in addition to the catalog entry that the shopper is viewing.
      REPLACEMENT
      Indicates that a replacement catalog entry is to return.
      For example, the following parameter indicates that only merchandising associations that have the type UPSELL are to return:
      <wcf:param name="associationType" value="UPSELL"/>
      To define a loop to include multiple merchandising association types, use the following format:
      <c:forEach var="maType" items=" "> 
       <wcf:param name="associationType" value="${maType}"/> 
      </c:forEach>
      Where the value for the attribute items lists the association types to return, for example:
      <c:forEach var="maType" items="UPSELL,X-SELL,ACCESSORY"> 
       <wcf:param name="associationType" value="${maType}"/> 
      </c:forEach>
    4. Save and close the file.
  4. Verify that your catalog page displays only the merchandising associations that you customized the productViewHandler REST service to return.
    1. Open your store in a web browser.
    2. Browse your store and open the catalog entry details page for a catalog entry that matches the correct catalog entry type.
    3. Verify that the only merchandising associations that display match the merchandising associations types that you customized the REST service to return.