Use > Service Catalogs > Service Catalog management > Customizing Service Catalog search result

Customizing Service Catalog search result

By default, you can submit a Service Catalog request from Service Catalog > Order from Catalog and then search for the desired cart items, or submit a Support Catalog request from Service Catalog > Non-cart Catalog Requests and then search for the non-cart services. These two search results are under different formats in an out-of-box Service Manager system and cannot be merged. However, you can customize the Service Catalog search result to include both cart items and non-cart items for better user experience.

Follow these steps:

Applies to User Roles:

System Administrator

  1. Log on to Service Manager as System Administrator.
  2. Type ds in the command line, and then press Enter.
  3. Type svcCat.display.catalog in the Screen ID field, and then click Search.
  4. Update the initialization expressions as follows:

    1. Locate line 9. Replace both $L.valueCat=$G.svcCat.noncart.category.values and $L.valueCat=$G.svcCat.category.values with $L.valueCat=$G.svcCat.category.values+$G.svcCat.noncart.category.values.
    2. Locate line 10. Replace both $L.displayCat=$G.svcCat.noncart.category.display.values and $L.displayCat=$G.svcCat.category.display.values with $L.displayCat=$G.svcCat.noncart.category.display.values+$G.svcCat.category.display.values.
  5. Click Save and OK.
  6. Type sl in the command line, and then press Enter.
  7. Type svcCatCategory in the Name field, and then click Search.
  8. Update the scripts as follows:

    1. Locate function getAllItemsbyType, and then comment the following codes:

      if (nonCart)
      fSql+=" and non.cart=true ";
      else 
      fSql+=" and (non.cart=NULL or non.cart=false)";
    2. Locate function buildRADInitFieldsQuery, and then comment the following codes:

      if ("noncart"==vars["$L.type"]){
      catalogSql = catalogSql + " and non.cart=true";
      } else {
      catalogSql = catalogSql + " and (non.cart=NULL or non.cart=false)";
      }
    3. Locate function buildRADSetSearchQuery, and then comment the following codes:

      if (type == "noncart") 
      { 
      subSql=" and non.cart=true ";
      } else { 
      subSql=" and (non.cart=NULL or non.cart=false)";
      }
  9. Click Save and OK.

Note After these configurations, you can click Service Catalog > Order from Catalog to order both cart items and non-cart items. However, the search results from Non-cart Catalog Requests still include non-cart items only.