Feature Pack 7 or later

Customizing WebSphere Commerce search in the storefront

You can customize WebSphere Commerce search in the storefront to suit your business needs. You can customize WebSphere Commerce search according to your role within the WebSphere Commerce site.

Search requests are typically initiated from the storefront. The most important parameter that is specified when you are initiating a search request is the search profile. A search profile can be passed to the WebSphere Commerce search runtime by adding it as a parameter in the wcf:rest tag.

Depending on where the custom search profile is called in the storefront, different JSP widgets must be updated.

For example, to call the custom search profile that is created in WebSphere Commerce search programming model, extension points, and customization tasks, when you are performing a simple keyword search:

Procedure

  1. Update the SearchSetup.jspf file in the common directory of your store:
    • WC_installdir\workspace\Stores\WebContent\widgetdir\Common
  2. Replace IBM_findProductsBySearchTerm by the custom search profile X_findCatalogEntryByfield1.
    Important: The custom profile should extend the profile that is being replaced in this step to avoid losing any settings from the previous profile.

    Index fields that are mapped to the CatalogEntryView user data fields can be displayed in the storefront by modifying the JSP file where it should be displayed.

    To display the CatalogEntry customizable fields, field3, and field5, they can be displayed in the CatalogEtnry widget:
    
    <c:out value="Custom field3: ${catalogEntryView.UserData.field3}" />
    <c:out value="Custom field5: ${catalogEntryView.UserData.field5}" />